# Describe the units in $\mathbb{Z}[\sqrt{-d}]$

I need help describing all the units in the ring $\mathbb{Z}[\sqrt{-d}]=\{a+b\sqrt{-d}|a,b\in\mathbb{Z}\}$ where $d>0$ and is square-free.

Thanks.

-
Assuming $d>0$, there are not many ways that $N(a+b\sqrt{-d})=a^2+d\,b^2$ is $\pm 1$. – lhf Dec 19 '13 at 2:59
Can $d$ be positive or negative? – Michael Albanese Dec 19 '13 at 3:00
I've edited it so that $d$ is positive – BlakeM Dec 19 '13 at 4:40

First of all, $\mathbb{Z}[\sqrt{-d}]$ is a subring of $\mathbb{Q}[\sqrt{-d}]$ which has field norm $$N(a + b\sqrt{-d}) = (a + b\sqrt{-d})(a-b\sqrt{-d}) = a^2 + db^2.$$ This norm is multiplicative (i.e. $N(\alpha\beta) = N(\alpha)N(\beta)$).
Suppose $\alpha \in \mathbb{Z}[\sqrt{-d}]$ is a unit. Using the fact that there is an element $\beta \in \mathbb{Z}[\sqrt{-d}]$ such that $\alpha\beta = 1$, you can determine the possible values of $N(\alpha)$. Then it is just a matter of solving the equation $N(a + b\sqrt{-d}) = a^2+db^2 = N(\alpha)$ for each possible value of $N(\alpha)$. The difficulty of solving these equations changes drastically depending on whether $d$ is positive or negative.
Added later: As $d$ is now positive, $db^2 \geq 0$ for all $b \in \mathbb{Z}$; this makes things much easier. If $d$ were negative, you would need to solve Pell's equation (as well as a slightly modified Pell's equation), which is much harder. In fact, if $d$ is positive, there are only finitely many units (four if $d = 1$, and two if $d > 1$), but if $d$ is negative, there are infinitely many units (though they can all be expressed as powers of a single unit, which corresponds to the fact that Pell's equation and its variant possess a fundamental solution from which all other solutions can be generated).
Also note that for $d \equiv 2, 3 \pmod 4$, $\mathbb{Z}[\sqrt{-d}]$ is the ring of integers in the quadratic field $\mathbb{Q}[\sqrt{-d}]$. However, if $d \equiv 1 \pmod 4$, then $\mathbb{Z}\left[\frac{1+\sqrt{-d}}{2}\right]$, which contains $\mathbb{Z}[\sqrt{-d}]$ as a proper subring, is the ring of integers in the quadratic field $\mathbb{Q}[\sqrt{-d}]$. The distinction here is important. For example, there are only two units in $\mathbb{Z}[\sqrt{-3}]$ while there are six in $\mathbb{Z}\left[\frac{1 + \sqrt{-3}}{2}\right]$.