How do I find the quotient field of $\mathbb{Z}[\sqrt{d}]$? Our teacher said sometimes the quotient field is $\mathbb{Q}[\sqrt{d}]$ and sometimes it's $\mathbb{Q}[\frac{1+\sqrt{d}}{2}]$. How do we decide, or what are the conditions on $d$ which helps us to decide, which is when?
 A: A number is called an algebraic integer if it is algebraic and the monic minimal polynomial has whole number coefficients. By looking at the minimal polynomial of a number $a+b\sqrt{d}$ with $a,b \in \mathbb{Q}$ which is $X^2 -2aX + a^2-b^2d$ you get, that $2a$ and $a^2-b^2d$ have to be whole numbers. Assuming $d$ is a squarefree integer, there is a (not so short, but simple) proof to get the number ring:
Looking at the minimal polynomial coefficents, you get that either both $a$ and $b$ are whole numbers, or $2a=k$ is an odd number and $a^2-b^2d \in \mathbb{Z}$ which is equivalent (by multiplying by $4$) to $k^2 \equiv 4b^2d \mod 4$. ($b$ is not necessarily in $\mathbb{Z}$ but $4b^2d$ is!) Since $k$ is odd, $k^2 \equiv 1 \mod 4$, so you get $4b^2d \equiv 1 \mod 4$. Writing $b=\frac p q$ ($p$, $q$ coprime) and using the definition of congruence, you get $\exists n \in \mathbb{Z}: (4n-1)q^2 = 4p^2d$. Since $d$ is assumed squarefree, $q^2$ and $d$ are coprime, so $q^2$ and $p^2d$ are coprime and we get $q^2 \vert 4$, so $q=1,2$. $q=1$ leads to a contradiction mod $4$, so $q=2$ and $p$ must be odd. We get $\exists n \in \mathbb{Z}: (4n-1) = p^2d$. Since $p$ is odd $p^2 \equiv 1 \mod 4$ so reducing modulo $4$ gives $d \equiv -1 \mod 4$.
This shows the implication: $\frac{1+\sqrt d} 2$ algebraic integer, then $d \equiv -1 \mod 4$. (a rather ugly proof, if you ask me...) The inverse statement is a little easier to prove, just plug in $a=b= \frac 1 2$. Working out the rings of integers from this is easy now.
