# Integral closure of $\mathbb{Z}$ in $\mathbb{Q}(\sqrt{d})$

Let $$d$$ be a square free integer. What is the integral closure of $$\mathbb{Z}$$ in $$\mathbb{Q}(\sqrt{d})$$?

Do we have to do a case analysis for $$d \equiv 1,2,3 \pmod{4}$$? Let $$S$$ denote the integral closure of $$\mathbb{Q}(\sqrt{d})$$. Then for $$d \equiv 1 \pmod{4}$$, I see that $$\frac{1 + \sqrt{d}}{2} \in S$$, since $$x^{2} - x - \frac{d-1}{4} = f(x)$$ satisfies $$f(\frac{1 + \sqrt{d}}{2}) = 0$$, but how to prove that $$\mathbb{Z}[\frac{1 + \sqrt{d}}{2}] = S$$? I do not know how to proceed for the other cases. Clearly, $$\mathbb{Z}[\sqrt{d}] \subset S$$ regardless of the residue of $$d$$ modulo 4.

• There are many proofs on the web. – rogerl Mar 26 at 15:41

The only prime that can be singular in $$\Bbb{Z}[\sqrt{d}]$$ is $$2$$. This happens only when $$d\equiv1\pmod{4}$$. Now verify that $$2$$ is not singular in $$\Bbb{Z}[\tfrac{1+\sqrt{d}}{2}]$$.