MathLabs
TheoremProved

The ring of integers of a quadratic field

Statement

Let dd be a squarefree integer, d≠1d\neq1, and K=Q(d)K=\mathbb Q(\sqrt d). Then OK=Z[d]\mathcal O_K=\mathbb Z[\sqrt d] if d≡2,3(mod4)d\equiv2,3\pmod4, and OK=Z ⁣[1+d2]\mathcal O_K=\mathbb Z\!\left[\dfrac{1+\sqrt d}2\right] if d≡1(mod4)d\equiv1\pmod4.

Why is it true?

Knowing exactly what the integers of KK are is the mandatory first step for doing arithmetic in KK: factoring elements or ideals, computing class groups, or deciding which primes ramify all require an honest description of OK\mathcal O_K, not the naive guess Z[d]\mathbb Z[\sqrt d], which is wrong exactly half the time.

Proof sketch

Write α=a+bd\alpha=a+b\sqrt d with a,b∈Qa,b\in\mathbb Q. If b=0b=0, α=a∈Q\alpha=a\in\mathbb Q is an algebraic integer iff a∈Za\in\mathbb Z (rational root theorem), which is the case b=0b=0 of Z[d]\mathbb Z[\sqrt d]. If b≠0b\neq0, the minimal polynomial of α\alpha over Q\mathbb Q is x2−2ax+(a2−db2)x^2-2ax+(a^2-db^2) (its trace is 2a2a, its norm a2−db2a^2-db^2), so α\alpha is integral iff both 2a∈Z2a\in\mathbb Z and a2−db2∈Za^2-db^2\in\mathbb Z.

Write u=2a∈Zu=2a\in\mathbb Z. From a2−db2∈Za^2-db^2\in\mathbb Z, multiplying by 44 gives u2−4db2∈4Z⊂Zu^2-4db^2\in4\mathbb Z\subset\mathbb Z, so 4db2∈Z4db^2\in\mathbb Z. Write b=p/qb=p/q in lowest terms (gcd⁡(p,q)=1\gcd(p,q)=1); then 4db2=4dp2/q2∈Z4db^2=4dp^2/q^2\in\mathbb Z forces q2∣4dp2q^2\mid4dp^2, and since gcd⁡(p,q)=1\gcd(p,q)=1 this forces q2∣4dq^2\mid4d. Because dd is squarefree, the largest perfect square dividing 4d4d is at most 44, so q2∣4q^2\mid4, i.e. q∈{1,2}q\in\{1,2\}; either way v:=2b∈Zv:=2b\in\mathbb Z.

Now substitute u=2au=2a, v=2bv=2b (both integers) into a2−db2∈Za^2-db^2\in\mathbb Z: this becomes u2−dv24∈Z\tfrac{u^2-dv^2}{4}\in\mathbb Z, i.e. u2≡dv2(mod4)u^2\equiv dv^2\pmod4. Squares mod 44 are only 00 (even) or 11 (odd). If vv is even, dv2≡0(mod4)dv^2\equiv0\pmod4 forces uu even too (since u2u^2 odd would give 1≢01\not\equiv0); so u,vu,v both even, meaning a,b∈Za,b\in\mathbb Z — the "trivial" solution, always available, giving Z[d]⊆OK\mathbb Z[\sqrt d]\subseteq\mathcal O_K always.

If vv is odd, dv2≡d(mod4)dv^2\equiv d\pmod4 (since v2≡1v^2\equiv1), so we need u2≡d(mod4)u^2\equiv d\pmod4. If d≡2,3(mod4)d\equiv2,3\pmod4 (i.e. d≡2,3(mod4)d\equiv2,3\pmod4), no square u2∈{0,1}(mod4)u^2\in\{0,1\}\pmod4 can equal 22 or 3(mod4)3\pmod4, so this case is impossible — only the trivial u,vu,v both even survives, giving exactly OK=Z[d]\mathcal O_K=\mathbb Z[\sqrt d]. If instead d≡1(mod4)d\equiv1\pmod4 (d≡1(mod4)d\equiv1\pmod4), we need u2≡1(mod4)u^2\equiv1\pmod4, satisfied whenever uu is odd — and since vv is already odd, u≡v(mod2)u\equiv v\pmod2 is exactly the condition for α=u+vd2\alpha=\tfrac{u+v\sqrt d}2 with u,vu,v both odd, which is precisely Z+Z⋅1+d2\mathbb Z+\mathbb Z\cdot\tfrac{1+\sqrt d}2 (check: 1+d2\tfrac{1+\sqrt d}2 itself has u=v=1u=v=1, both odd), so in this case OK=Z ⁣[1+d2]\mathcal O_K=\mathbb Z\!\left[\tfrac{1+\sqrt d}2\right], strictly larger than Z[d]\mathbb Z[\sqrt d] (index 22).

Topics that use this theorem

Step-by-step proofs

No step-by-step proof yet for this theorem.

References

  1. J. Neukirch (1999). Algebraic Number Theory · DOI:10.1007/978-3-662-03983-0
  2. M. Bhargava (2005). The density of discriminants of quartic rings and fields · DOI:10.4007/annals.2005.162.1031
  3. The LMFDB Collaboration (2026). The L-functions and modular forms database (LMFDB)