# On finding an integral basis of $\mathbb{Q}[\sqrt{5}]$

On section 2.4 of the book Algebraic Number Theory (by Stewart and Tall), there is an example showing how to derive an integral basis to the number field $K = \mathbb{Q}[\sqrt{5}]$.

It is said that any element $y$ of $K$ is of the form $p + q\sqrt{5}$, with $p$ and $q$ in $\mathbb{Q}$ and have minimal polynomial

$$(x - p - q\sqrt{5})(x - p + q\sqrt{5}) = x^2 -2px + (p^2 - 5q^2)$$

Also, such $y$ belongs to $\mathcal{O}_K$ if $2p \in \mathbb{Z}$ and $(p^2 - 5q^2) \in \mathbb{Z}$. Thus, $p = \frac{1}{2} \alpha$, with $\alpha \in \mathbb{Z}$.

Until here, everything is fine. But then, it is said that

1. If $\alpha$ is even, $p^2 \in \mathbb{Z}$ and then $q \in \mathbb{Z}$.
2. If $\alpha$ is odd, then $q = \frac{1}{2}\beta$ for some $\beta \in \mathbb{Z}$.

And finally, the conclusion is

From this it follows that $\mathcal{O}_K = \mathbb{Z}[\frac{1}{2} + \frac{1}{2}\sqrt{5}]$ and an integral basis is $\{1, \frac{1}{2} + \frac{1}{2}\sqrt{5} \}$

But I don't understand how conditions 1. and 2. imply in that conclusion. I think that condition 1. would imply in $y$ to be of the form $\frac{1}{2}\alpha + \gamma\sqrt{5}$ for some $\gamma \in \mathbb{Z}$ and that condition 2. would imply in $y$ to be of the form $\gamma + \frac{1}{2}\beta\sqrt{5}$...

Could someone here clarify that point of the example?

If $\alpha$ is even, then $p=\frac{1}{2}\alpha$ is an integer, so $p^2$ is an integer, and therefore in order for $p^2-5q^2$ to be an integer (as we know it must be), we must have that $5q^2$ is an integer, and hence $q$ must be an integer.

If $\alpha$ is odd, then $\alpha^2$ is odd, and $p^2=\frac{\alpha^2}{4}$, and therefore in order for $p^2-5q^2$ to be an integer (as we know it must be), we must have $$p^2+(\text{an integer})=\frac{(\text{odd})}{4}=\frac{5a^2}{b^2}=5q^2$$ where $q=\frac{a}{b}$ is in lowest terms. Therefore $a$ is odd and $b=2$.

Now you have shown that any $p+q\sqrt{5}$ in $\mathcal{O}_K$ either has $p,q\in\mathbb{Z}$, or $p=\frac{a}{2}$ and $q=\frac{b}{2}$ for odd $a,b\in\mathbb{Z}$.

In other words, you have shown that $$\mathcal{O}_K=\{\tfrac{a}{2}+\tfrac{b}{2}\sqrt{5}:a,b\in\mathbb{Z},\; a\equiv b\bmod 2\}$$ You can write any such element as $\frac{a-b}{2}(1)+b(\frac{1}{2}+\frac{1}{2}\sqrt{5})$ to demonstrate that $\{1,\frac{1}{2}+\frac{1}{2}\sqrt{5}\}$ is an integral basis for $\mathcal{O}_K$.

• Ok, I got it. But why does it imply in that integral basis? – Hilder Vítor Lima Pereira Aug 26 '16 at 2:45
• @Vitor: I've added that to my answer. – Zev Chonoles Aug 26 '16 at 4:02
• Thanks you! I last little issue... The condition $a \equiv b \mod 2$ forces $a$ and $b$ to have the same parity. But in the first case, where $\alpha$ is even, why must $q$ be even? – Hilder Vítor Lima Pereira Aug 26 '16 at 12:11
• @Vitor: It's not the case that $q$ must be even. Note that in the expression $$\tfrac{a}{2}+\tfrac{b}{2}\sqrt{5}$$ if both $a$ and $b$ are even, that just means we have $$(\text{an integer})+(\text{an integer})\sqrt{5}$$ and neither of those integers are necessarily even. If both $a$ and $b$ are odd, then we have $$(\text{an integer}+\tfrac{1}{2})+(\text{an integer}+\tfrac{1}{2})\sqrt{5}$$ – Zev Chonoles Aug 26 '16 at 17:39
• Ok, Zev! Thank you for helping! – Hilder Vítor Lima Pereira Aug 26 '16 at 18:35