Dirichlet’s unit theorem gives all units of an algebraic number field  $\mathbb{Q}(\vartheta)$ in the unique form

 $\varepsilon=\zeta^{n}\eta_{1}^{k_{1}}\eta_{2}^{k_{2}}...\eta_{t}^{k_{t}},$

where $\zeta$ is a primitive $w^{\mathrm{th}}$ root of unity  in $\mathbb{Q}(\vartheta)$, the $\eta_{j}$’s are the fundamental units  of $\mathbb{Q}(\vartheta)$,  $0\leqq n\leqq w\!-\!1$,  $k_{j}\in\mathbb{Z}$$\forall j$,  $t=r\!+\!s\!-\!1$.

• The case of a real quadratic field  $\mathbb{Q}(\sqrt{m})$, the square-free$m>1$:  $r=2$,  $s=0$,  $t=r\!+\!s\!-\!1=1$.  So we obtain

 $\varepsilon=\zeta^{n}\eta^{k}=\pm\eta^{k},$

because  $\zeta=-1$  is the only real primitive root of unity ($w=2$).  Thus, every real quadratic field has infinitely many units and a unique fundamental unit $\eta$.

Examples:  If  $m=3$,  then  $\eta=2\!+\!\sqrt{3}$;  if  $m=421$,  then  $\eta=\frac{444939+21685\sqrt{421}}{2}$.

• The case of any imaginary quadratic field $\mathbb{Q}(\vartheta)$; here  $\vartheta=\sqrt{m}$,  the square-free  $m<0$:  The conjugates  of $\vartheta$ are the pure imaginary numbers $\pm\sqrt{m}$, hence  $r=0$,  $2s=2$,  $t=r\!+\!s\!-\!1=0$.  Thus we see that all units are

 $\varepsilon=\zeta^{n}.$

1) $m=-1$.  The field contains the primitive fourth root of unity, e.g. $i$, and therefore all units in the field $\mathbb{Q}(i)$ are $i^{n}$, where  $n=0,\,1,\,2,\,3$.

2) $m=-3$.  The field in question is a cyclotomic field  (http://planetmath.org/CyclotomicExtension) containing the primitive third root of unity and also the primitive sixth root of unity, namely

 $\zeta=\cos{\frac{2\pi}{6}}+i\sin{\frac{2\pi}{6}};$

hence all units are  $\varepsilon=(\frac{1+\sqrt{-3}}{2})^{n}$,  where  $n=0,\,1,\,\ldots,\,5$, or, equivalently,   $\varepsilon=\pm(\frac{-1+\sqrt{-3}}{2})^{n}$,  where  $n=0,\,1,\,2$.

3) $m=-2$,  $m<-3$.   The only roots of unity in the field are $\pm 1$; hence  $\zeta=-1$,  $w=2$,  and the units of the field are simply  $(-1)^{n}$, where  $n=0,\,1$.