Invertible elements of $\mathbb{Z}[i\sqrt{n}]$ Let $n>1$ a natural number for which there does not exist an $m \in \mathbb{N}$ such that $m^2|n$.
Prove that the only invertible elements of the integral domain  $\mathbb{Z}[i\sqrt{n}]$ are $-1$ and $1$.
$\mathbb{Z}[i\sqrt{n}]=\{a+bi \sqrt{n}|a,b \in \mathbb{Z}\}$
Can someone help me with this?
 A: If $a+bi\sqrt{n}$ is an invertible element of $\mathbb{Z}[i\sqrt{n}]$, then its norm must be an invertible element in $\mathbb{Z}$, so must be $\pm 1$.
And the norm of $a+bi\sqrt{n}$ is $(a+bi\sqrt{n})(a-bi\sqrt{n})=a^2+b^2n$. If this is equal to $\pm 1$, what are the possible values of $a$ and $b$?
A: In general :To determine invertible elements in $\mathbb Z[\sqrt n]$ where $n$ free of square::
Let be $u=a+b\sqrt n $ an invertible element in $\mathbb Z[\sqrt n]$, then exists $v=c+d\sqrt n \in \mathbb Z[\sqrt n] $ where $uv=1$ , then $N(uv)=N(u)N(v)=1\Rightarrow N(u)=1$. we  have three cases: 
$1)$ $n=-1 \Rightarrow N(u)=a^2+b^2=1\Rightarrow a=\pm 1, b=0$ or $a=0, b=\pm 1$, then $u=\pm 1$ or $u=\pm i$
$2)$ $n<-1 \Rightarrow N(u)=a^2-nb^2=1 \Rightarrow a=\pm 1, b=0$  ,then $u=\pm 1$
$3)$ $n>0 \Rightarrow N(u)=a^2-nb^2=1$ has infinitely many of solutions , then invertible element is $\{-1,+1 \}$ and infinite many of elements. 
for example for case $(3)$ in $\mathbb Z[\sqrt3]$ we have $u=2-\sqrt3$ is invertible element because $(2-\sqrt3)(2+\sqrt3)=1$
Hint: if $n<0$ ,then $\mathbb Z[\sqrt n]$ is PID if and only if $n=-1$ or $n=-2$
