Describing integral closure of quadratic number fields
I'm facing the following problem.
Let $p$ be a prime and $ K=\mathbb{Q}(\sqrt{p}) $. I'm trying to find the integral closure of $ \mathbb{Z} $ in $ K $.
I don't really know where to start. I've managed to prove that $ \mathbb{Z}[\sqrt{p}] $ is in the integral closure and I'm almost sure $ \mathbb{Q} $ is not.
I can't think of a systematic way to approach this. I would appreciate any help.
Solution 1:
The integral closure of $\mathbb{Z}$ in $K$ is denoted by $\mathcal{O}_K$, the ring of integers in $K$, which is easy to determine for quadratic number fields. For $p\equiv 2,3 \bmod 4$ we have $\mathbb{O}_K=\mathbb{Z}[\sqrt{p}]$, and for $p\equiv 1\bmod 4$ we have $\mathbb{O}_K=\mathbb{Z}[\frac{1+\sqrt{p}}{2}]$. To see this, we can use that the trace and the norm of an element $\alpha=a+b\sqrt{p}$ are in $\mathcal{O}_{\mathbb{Q}}=\mathbb{Z}$. This means, $tr(\alpha)=2a \in \mathbb{Z}$ and $N(\alpha)=a^2-b^2p\in\mathbb{Z}$ are in $\mathcal{O}_K$. It follows that $4a^2\in \mathbb{Z}$, hence $4b^2p\in \mathbb{Z}$. Hence $2b\in \mathbb{Z}$. Now it is easy to see that either $a,b\in \mathbb{Z}$ or $a,b\in \frac{1}{2}+\mathbb{Z}$, according to the remainder modulo $4$.