I was recently reading about integral ring extensions. One of the first examples given is that $\mathbb{Z}$ is integrally closed in its quotient field $\mathbb{Q}$. Another is that $\mathbb{Z}[\sqrt{5}]$ is not integrally closed in $\mathbb{Q}(\sqrt{5})$ since for example $(1+\sqrt{5})/2\in\mathbb{Q}[\sqrt{5}]$ is integral over $\mathbb{Z}$ as a root of $X^2-X-1$, but $(1+\sqrt{5})/2\notin\mathbb{Z}[\sqrt{5}]$.

Now I'm curious, can we find what are all integers $n$ such that $\mathbb{Z}[\sqrt{n}]$ is integrally closed (equal to its integral closure in its quotient field)?

One thing I do know is that unique factorization domains are integrally closed, so I think rings like $\mathbb{Z}[\sqrt{-1}]$, $\mathbb{Z}[\sqrt{-2}]$, $\mathbb{Z}[\sqrt{2}]$ and $\mathbb{Z}[\sqrt{3}]$ are integrally closed, as they are Euclidean domains, and thus are UFDs. But can we say what all integers $n$ are such that $\mathbb{Z}[\sqrt{n}]$ is integrally closed? Thanks!


3 Answers 3


Here's an extremely low-level way of doing it, just using the definition and some easy integer computations.

We may write $n=d^2m$, where $d$ and $m$ are integers, and $m$ is square free. Then $\mathbb{Q}(\sqrt{n}) = \mathbb{Q}(\sqrt{m})$, and $$\mathbb{Z}[\sqrt{n}] = \{a + db\sqrt{m}\mid a,b\in\mathbb{Z}\}.$$

If $m=1$, then $\mathbb{Z}[\sqrt{n}]=\mathbb{Z}$, $\mathbb{Q}(\sqrt{n}) = \mathbb{Q}$, so $\mathbb{Z}[\sqrt{n}]$ is integrally closed in $\mathbb{Q}[\sqrt{n}]$.

Assume then that $m\neq 1$.

If $d^2\gt 1$, then $\sqrt{m}\in\mathbb{Q}(\sqrt{n})$, and satisfies $x^2-m\in\mathbb{Z}[x]$, but is not in $\mathbb{Z}[\sqrt{n}]$. So we may assume $d^2=1$; that is, $n$ is squarefree.

Now assume that $a=\frac{p}{q} + \frac{r}{s}\sqrt{n}\in\mathbb{Q}(\sqrt{n})$ ($n$ squarefree, $n\neq 1$), $\gcd(p,q)=\gcd(r,s)=1$, $q\gt 0$, $s\gt 0$, is integral over $\mathbb{Z}$. If $r=0$, then $a\in\mathbb{Q}$, so by virtue of being integral it lies in $\mathbb{Z}\subseteq\mathbb{Z}[\sqrt{n}]$.

If $r\neq 0$, then $a$ satisfies the polynomial $$\left( x - \frac{p}{q}-\frac{r}{s}\sqrt{n}\right)\left(x - \frac{p}{q}+\frac{r}{s}\sqrt{n}\right)$$ that is, $$x^2 - \frac{2p}{q}x + \frac{p^2}{q^2}-\frac{r^2n}{s^2}.$$ For $a$ to be integral, this must have integer coefficients. In particular, $q|2p$, and so either $q=1$ or $q=2$.

If $q=1$, then we must have $s^2|n$. Since $n$ is squarefree, this requires $s=1$. So if $q=1$, then the element must be in $\mathbb{Z}[\sqrt{n}]$ and we are fine.

Can $q=2$? If $q=2$, then we need $$\frac{p^2}{4} - \frac{r^2n}{s^2} = \frac{p^2s^2 - 4r^2n}{4s^2}\in\mathbb{Z}.$$ Therefore, $4|p^2s^2$; since $q=2$, then $p$ is odd, so $4|s^2$, and so $s=2k$ is even. We have $$\frac{4p^2k^2 - 4r^2n}{16k^2} = \frac{p^2k^2-r^2n}{4k^2}\in\mathbb{Z}.$$ Now, both $p$ and $r$ are odd, so $p^2\equiv r^2\equiv 1\pmod{4}$; since $4$ divides $p^2k^2-r^2n$, and $p^2k^2-r^2n\equiv k^2-n\equiv 0\pmod{4}$, then remembering that $n$ is square free (hence not congruent to $0$ modulo $4$) we conclude that $n\equiv 1\pmod{4}$.

So the only way in which $\mathbb{Z}[\sqrt{n}]$ with $n$ squarefree can fail to be integrally closed is if $n\equiv 1\pmod{4}$. And indeed, if $n\equiv 1 \pmod{4}$, then we can take $p=r=1$, $q=s=2$, and we get that $\frac{1}{2}+\frac{1}{2}\sqrt{n}$ is integral but not in $\mathbb{Z}[\sqrt{n}]$.

In summary: if $n=d^2m$ with $m$ square free, then:

  1. If $m=1$, then $\mathbb{Z}[\sqrt{n}]=\mathbb{Z}$ is integrally closed in $\mathbb{Q}(\sqrt{n}) = \mathbb{Q}$.
  2. If $m\gt 1$ and $d^2\gt 1$, then $\mathbb{Z}[\sqrt{n}]$ is not integrally closed in $\mathbb{Q}(\sqrt{n})$, witnessed by $\sqrt{m}$.
  3. If $d^2=1$, and $n\not\equiv 1\pmod{4}$, then $\mathbb{Z}[\sqrt{n}]$ is integrally closed in $\mathbb{Q}(\sqrt{n})$.
  4. If $d^2=1$ and $n\equiv 1\pmod{4}$, then $\mathbb{Z}[\sqrt{n}]$ is not integrally closed in $\mathbb{Q}(\sqrt{n})$, witnessed by $\frac{1}{2}+\frac{1}{2}\sqrt{n}$.

So $\mathbb{Z}[\sqrt{n}]$ is integrally closed if and only if $n$ is a perfect square, or $n$ is square free, different from $1$, and not congruent to $1$ modulo $4$.

  • $\begingroup$ Why must $x^2-\frac{2p}{q}x+\frac{p^2}{q^2}-\frac{r^2n}{s^2}$ have integer coefficients? The definition of $a$ being integral over $\mathbb{Z}$ is that there exists some monic polynomial $f(x)\in\mathbb{Z}[x]$ such that $f(a)=0$. $\endgroup$
    – Anon
    May 16, 2023 at 0:12
  • $\begingroup$ I think I have come up with the answer to my own question; Gauss's lemma. Let $g(x)=x^2-\frac{2p}{q}x+\frac{p^2}{q^2}-\frac{r^2n}{s^2}\in\mathbb{Q}[x]$ and let $f(x)\in\mathbb{Z}[x]$ be the monic polynomial of smallest degree such that $f(a)=0$. Then $f(x)$ is irreducible in $\mathbb{Z}[x]$. But conjugation (sending $\sqrt{n}$ to $-\sqrt{n}$) is a ring automorphism of $\mathbb{Z}[\sqrt{n}]$ fixing $\mathbb{Z}$, so if $x-a$ is a factor of $f(x)$, then so is $x-\bar{a}$. Hence, $g(x)\vert f(x)$ in $\mathbb{Q}[x]$. But by Gauss's lemma, $f(x)$ is irreducible in $\mathbb{Q}[x]$, so $g(x)=f(x)$. $\endgroup$
    – Anon
    May 16, 2023 at 0:20
  • 1
    $\begingroup$ @Anon One can prove that $a$ is integral if and only if its monic irreducible has integer coefficients. $\endgroup$ May 16, 2023 at 0:56

Let's assume that $n$ is squarefree. I think it would be best to explore this without using knowledge of the answer. You want to find the integers in $\mathbf Q(\sqrt n)$. These are elements which satisfy a quadratic with integer coefficients. Every element looks like $a + b\sqrt{n}$ for some $a, b \in \mathbf Q$.

Recall that the conjugate of this element will be $a - b\sqrt n$. So it certainly satisfies \[ (X - a - b\sqrt n)(X - a + b\sqrt n) = X^2 - 2aX + a^2 - nb^2. \] You need the coefficients $-2a$ and $a^2 - nb^2$ to lie in $\mathbf Z$. (You might recognize these as the trace and norm.) If this is the case, then as $(2a)^2 - n(2b)^2$ is an integer (divisible by $4$) and $n$ is squarefree, it follows that $2b \in \mathbf Z$ as well.

At this point, it makes sense to work mod $4$: we know that this last expression vanishes there, and the only squares are $0$ and $1$. For example, if $n \equiv 2$ then $(2a)^2$ and $(2b)^2$ must both be congruent to $0$, and it follows that $a$ and $b$ are in $\mathbf Z$.

  • $\begingroup$ Thank you Dylan, I get that $(2a)^2-n(2b)^2$ is an integer, but why does that imply $2b$ is an integer? I only conclude $n(2b)^2$ is an integer. After that, I understand the rest of the argument. $\endgroup$
    – yunone
    Jan 20, 2012 at 6:41
  • 1
    $\begingroup$ @yunone Well, anything in the denominator of $(2b)^2$ would be a square, and hence can't be canceled by $n$. Does that make sense? $\endgroup$ Jan 20, 2012 at 14:13
  • $\begingroup$ Oh yes, that's clear now. Thanks. $\endgroup$
    – yunone
    Jan 21, 2012 at 22:06
  • 6
    $\begingroup$ Why do you need those coefficients to be in $\mathbb{Z}$? Why can´t $a-b \sqrt{n}$ be the root of another polynomial? $\endgroup$ Apr 29, 2014 at 16:37
  • 2
    $\begingroup$ Why does an integral element only need to “satisfy a quadratic” here? If $i\in ℚ[\sqrt{n}]$ being integral over $ℤ$ only means that there is some monic polynomial in $ℤ[x]$ that has $i$ as root. I know that the minimal polynomial of $i$ in $ℚ[x]$ must be of degree two by dimensionality, but the associated polynomial in $ℤ[x]$ (by multiplying with the common denominator of the coefficients) need not be monic anymore. What am I missing? $\endgroup$ Mar 4, 2020 at 16:01

$\mathbb Z[\sqrt{n}]$ is integrally closed in $\mathbb Q(\sqrt{n})$ ($n\in\mathbb Z$, $n\neq1$) if and only if $n$ is square free and $n$ is not congruent to $1$ mod $4$ (or $n$ is a perfect square, in that case we have $\mathbb Z$ and $\mathbb Q$; thanks Arturo).

Moreover, if $n\equiv1 \pmod 4$, then $\mathbb Z[\frac{1+\sqrt{n}}{2}]$ is integrally closed in $\mathbb Q(\sqrt{n})$.

Sketch of proof of why $\mathbb Z[\sqrt{n}]$ is integrally closed in $\mathbb Q(\sqrt{n})$ for $n$ a square free number not congruent to $1$ modulo $4$. Let $\mathcal O$ be the set of integers numbers in $\mathbb Q(\sqrt{n})$. We can see that $\mathbb Z[\sqrt{n}]\subseteq\mathcal O$ (looking for suitable polynomials).

Let $\alpha=p+q\sqrt{n}\in\mathcal O-\mathbb Z$ with $p,q\in\mathbb Q$. $\alpha$ is a root of the polynomial $$ f(x)=(x-\alpha)(x-\bar\alpha)=x^2-2px+(p^2-nq^2). $$ But $f(x)$ is monic and of minimal degree (with coefficients in $\mathbb Q$), so it has to divide to the monic polynomial $g(x)\in\mathbb Z[x]$ which $g(\alpha)=0$. This implies that $f(x)\in\mathbb Z[x]$, thus $2p,\; p^2-mq^2\in\mathbb Z$. Now, you should prove that $p$ and $q$ are in $\mathbb Z$ since $n\equiv 2,3\pmod4$.

  • 1
    $\begingroup$ Well, aren't you missing the cases where $n$ is a perfect square? In that case, $\mathbb{Z}[\sqrt{n}]=\mathbb{Z}$ and $\mathbb{Q}(\sqrt{n}) = \mathbb{Q}$... $\endgroup$ Jan 20, 2012 at 4:20
  • $\begingroup$ Thank you emiliocba. Do you mind explaining why the first statement is actually true? I've been trying to prove it myself, but have gotten stuck. I did realize that in the case where $n\equiv 1\bmod 4$, then writing $n=4k+1$, $\frac{1+\sqrt{n}}{2}$ is a root of $X^2-X-k$, but even then I'm note sure how to ensure $\frac{1+\sqrt{n}}{2}\notin\mathbb{Z}[\sqrt{n}]$. Also, how does one see the cases where $n$ is square free and $n\equiv 2,3\pmod{4}$? $\endgroup$
    – yunone
    Jan 20, 2012 at 4:26
  • $\begingroup$ I added how to prove it for $n\equiv 2,3\pmod4$. $\endgroup$
    – emiliocba
    Jan 20, 2012 at 5:08
  • $\begingroup$ Thanks for adding that emiliocba, I appreciate the help. $\endgroup$
    – yunone
    Jan 20, 2012 at 5:42
  • $\begingroup$ The opposite of "square-free" is not "perfect square". $\endgroup$
    – user26857
    May 18, 2020 at 7:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .