Quadratic fields are degree-2 extensions Q(d) of the rationals; the Gaussian integersZ[i] are the integers of the simplest imaginary one, Q(i). Key result: Z[i] is a Euclidean domain, hence a unique factorization domain, and its primes classify exactly which integers are sums of two squares. Applies across algebraic number theory, Diophantine equations, and cryptography. Foundational work by Gauss (1801, 1832), Dirichlet, and Dedekind (19th century).
💡 The Core Insight
Number-theoretic questions about Z become transparent when lifted into a larger ring where rational primes can split. The prime 5=(2+i)(2−i) factors in Z[i] precisely because 5≡1(mod4) and is a sum of two squares, 5=22+12. The behavior of a rational prime p in OK—split, inert, or ramified—is the engine driving the entire theory, governed by quadratic reciprocity through the Legendre/Kronecker symbol.
Formal Statement
DefinitionQuadratic Field
For a squarefree integer d∈/{0,1}, the quadratic field is
1
K=Q(d)={x+yd:x,y∈Q}.
Derivation hint: adjoin a root of the irreducible t2−d to Q; the quotient Q[t]/(t2−d) is a field of degree 2.K is real quadratic if d>0 and imaginary quadratic if d<0. The nontrivial Galois automorphism is conjugation σ(x+yd)=x−yd.
DefinitionNorm and Trace
For α=x+yd∈K, define the trace and norm by
2
Tr(α)=α+σ(α)=2x,N(α)=ασ(α)=x2−dy2.
Derivation hint: these are the coefficients of the characteristic polynomial t2−Tr(α)t+N(α) of multiplication-by-α on the Q-vector space K. The norm is multiplicative: N(αβ)=N(α)N(β). For the Gaussian integers, N(a+bi)=a2+b2.
DefinitionRing of Integers
The ring of integersOK is the integral closure of Z in K—the set of α∈K satisfying a monic polynomial with Z coefficients. Explicitly,
3
OK=⎩⎨⎧Z[d],Z[21+d],d≡2,3(mod4),d≡1(mod4).
Derivation hint: α=x+yd is integral iff Tr(α)=2x∈Z and N(α)=x2−dy2∈Z; analyzing parities of 2x,2y modulo 4 yields the two cases.
TheoremDiscriminant
The discriminant of K=Q(d) is
4
DK={d,4d,d≡1(mod4),d≡2,3(mod4).
It satisfies DK≡0 or 1(mod4) and equals det(Tr(ωiωj)) for any integral basis {ω1,ω2}.
Derivation hint: compute the Gram matrix of traces Tr(ωiωj) for the integral basis from [3]; its determinant gives [4].
TheoremGaussian Integers are Euclidean
The ring Z[i]=OQ(i) is a Euclidean domain with respect to the norm N(a+bi)=a2+b2. Consequently it is a principal ideal domain and a unique factorization domain. Its units are exactly {1,−1,i,−i}, the elements of norm 1.
:::proof[Euclidean property of Z[i]] Step 1 — Goal. Given α,β∈Z[i] with β=0, find q,r∈Z[i] with α=qβ+r and N(r)<N(β).
Step 2 — Exact quotient. Compute in the field Q(i):
5
βα=u+vi,u,v∈Q.
Derivation hint: rationalize αβˉ/(ββˉ)=αβˉ/N(β), splitting real and imaginary parts.
Step 3 — Round. Choose integers m,n with ∣u−m∣≤21 and ∣v−n∣≤21, and set q=m+ni, r=α−qβ.
Step 4 — Bound the remainder. Since r/β=(u−m)+(v−n)i,
Derivation hint: apply multiplicativity N(r)=N(β)N(r/β) and bound each rounded coordinate by 21.
Step 5 — Conclude. The division algorithm holds, so Z[i] is Euclidean; the standard chain Euclidean ⇒ PID ⇒ UFD finishes the proof. ■
TheoremClassification of Gaussian Primes
Up to units, the primes of Z[i] are exactly:
1+i, the unique ramified prime above 2, with 2=−i(1+i)2;
For rational primes p≡1(mod4): two conjugate split primes π,πˉ with p=ππˉ=a2+b2;
For rational primes p≡3(mod4): p itself remains inert (prime in Z[i]).
Derivation hint: a rational prime p splits iff −1 is a quadratic residue mod p, i.e. x2≡−1 is solvable; by Euler's criterion this happens iff p≡1(mod4).
:::svg[Splitting of rational primes in the Gaussian integer lattice Z[i]]
Why It Holds / Derivation
ProofSums of Two Squares from Gaussian Arithmetic
Step 1. A rational prime p is a sum of two squares iff p=N(a+bi) for some a+bi∈Z[i], iff p is reducible (splits) in Z[i].
Step 2.p splits iff the equation x2≡−1(modp) has a solution, since then p∣x2+1=(x+i)(x−i) while p∤(x±i), so p is not prime.
Step 3. By Euler's criterion,
7
(p−1)=(−1)(p−1)/2={+1,−1,p≡1(mod4),p≡3(mod4).
Derivation hint: (−1)(p−1)/2 records whether the order-2 element −1 lies in the squares of the cyclic group (Z/p)×.
Step 4 — Full count (Jacobi/Gauss). The number r2(n) of representations of n as an ordered sum of two squares is
Derivation hint: count Gaussian integers of norm n by factoring n into Gaussian primes and tracking the four units; the divisor sum tracks split-prime exponents.■
∎
mathematician · Carl Friedrich Gauss | 1777–1855
Gauss introduced the integers a+bi in his 1832 memoir on biquadratic reciprocity, proving their unique factorization and using them to formulate the biquadratic reciprocity law—a problem he could not state cleanly within Z alone. His 1801 Disquisitiones Arithmeticae had already developed the genus theory of binary quadratic forms, the form-theoretic shadow of quadratic field arithmetic. The "Gaussian integers" bear his name precisely because he recognized that enlarging the number system was the natural setting for reciprocity. Dedekind and Dirichlet later recast this form-language into the modern ideal-and-field framework.
Building Intuition
🧠 Intuition
Think of Z[i] as the square lattice in the complex plane, with the norm measuring squared distance to the origin. Euclidean division "rounds to the nearest lattice point," and the bound N(r)≤21N(β) holds geometrically because any point in a unit cell is within distance 21 of a corner. A rational prime p either fragments into two lattice points (split), sits at a doubled lattice point (ramified, only p=2), or remains atomic because no lattice point has norm p (inert). The whole story of which primes are sums of two squares is just asking: does the circle of radius p pass through a lattice point?
Worked Examples
:::example[Factoring 65 in Z[i]] Given:65=5⋅13, with 5≡1 and 13≡1(mod4).
Step 1.5=(2+i)(2−i), since 22+12=5.
Step 2.13=(3+2i)(3−2i), since 32+22=13.
Step 3. Combine: 65=(2+i)(3+2i)⋅(2−i)(3−2i). Compute (2+i)(3+2i)=6+4i+3i+2i2=4+7i, and (2+i)(3−2i)=6−4i+3i+2=8−i.
Step 4. This yields the two essentially different representations
9
65=N(4+7i)=42+72,65=N(8−i)=82+12.
Derivation hint: distinct pairings of conjugate split primes give distinct norm-form representations.65=42+72=82+12 (two representations, confirming r2-style multiplicity).
ExampleComputing DK and OK for Q(5)
Given:d=5, which is squarefree and 5≡1(mod4).
Step 1. By [3], OK=Z[21+5]. The generator ω=21+5 (the golden ratio) is integral, satisfying ω2−ω−1=0.
Step 2. By [4], since d≡1(mod4), the discriminant is DK=5.
Step 3. Check via the trace form on basis {1,ω}: Tr(1)=2, Tr(ω)=1, Tr(ω2)=Tr(ω+1)=3.
10
DK=det(2113)=6−1=5.
Derivation hint: the discriminant equals det(Tr(ωiωj)); entries are Tr(1⋅1),Tr(1⋅ω),Tr(ω⋅ω).OK=Z[21+5],DK=5.
Common Misconceptions
⚠️ Common mistake
The ring of integers is NOT always Z[d]. For d≡1(mod4) you must use the half-integer basis 21+d. Using Z[5] instead of Z[21+5] gives an order of index 2, with wrong discriminant (20 vs 5) and a non-maximal, badly-behaved ideal theory.
⚠️ Common mistake
Norm being prime is sufficient but not necessary for an element to be prime. If N(α) is a rational prime then α is a Gaussian prime; but α=3 is a Gaussian prime with N(3)=9 composite. Inert primes have composite (square) norm.
CounterexampleUnique factorization can fail
In Z[−5]=OQ(−5) (here −5≡3(mod4) so this is the full ring of integers),
11
6=2⋅3=(1+−5)(1−−5),
and all four factors are irreducible and non-associate, with norms 4,9,6,6. Derivation hint: check no element has norm 2 or 3 (i.e. a2+5b2∈{2,3} is insoluble), so the factors cannot be split further or matched up. The class number is h(Q(−5))=2>1, measuring exactly this failure. Unlike Z[i], this ring is a Dedekind domain but not a PID—ideals still factor uniquely even though elements do not.
Connections
connection
Quadratic fields are the degree-2 case of Algebraic Number Fields, and their integers are the simplest Dedekind Domains where Unique Factorization of Ideals replaces element factorization. The split/inert/ramified trichotomy is governed by Quadratic Reciprocity through the Kronecker symbol (pDK). The failure of unique factorization is measured by the Ideal Class Group, whose order is the class number h, and the structure of units in real quadratic fields is the content of Dirichlet's Unit Theorem and the Pell Equation. Imaginary quadratic fields connect to Complex Multiplication and the theory of elliptic curves with CM.
Real-World Applications
🔬 Where this appears
Historical Development
⏳ History
- 1640 — Fermat states (in a letter to Mersenne) that every prime p≡1(mod4) is a sum of two squares, without published proof.
- 1749–1770 — Euler proves Fermat's two-square theorem and develops infinite descent and quadratic residue tools.
- 1798 — Legendre formulates quadratic reciprocity (with an incomplete proof) and the Legendre symbol.
- 1801 — Gauss publishes Disquisitiones Arithmeticae, giving the first complete proofs of quadratic reciprocity and the genus theory of binary quadratic forms.
- 1832 — Gauss introduces Z[i] to state biquadratic reciprocity, proving its unique factorization.
- 1840s — Dirichlet proves the unit theorem and the class number formula for quadratic forms; Eisenstein develops Z[ω] for cubic reciprocity.
- 1871 — Dedekind defines ideals and integral closure, recasting quadratic-field arithmetic as the theory of Dedekind domains in his supplements to Dirichlet's lectures.
- 1900s — Hilbert's Zahlbericht and class field theory systematize quadratic fields as the genesis of all abelian extension theory.
Subtleties & Limits
open-problem
Class number problems remain partly open. Gauss conjectured (proved by Heilbronn 1934, effectivized by Baker–Stark 1966) that there are exactly nine imaginary quadratic fields with class number 1: d=−1,−2,−3,−7,−11,−19,−43,−67,−163. By contrast, it is still unknown whether infinitely many real quadratic fields have class number 1—the Gauss class number 1 problem for real fields is open. The Cohen–Lenstra heuristics predict that roughly 75.4% of real quadratic fields are principal, but no proof exists. Effective bounds on class numbers and the precise distribution of split versus inert primes (linked to the Generalized Riemann Hypothesis through L(1,χ)) remain active frontiers.
See Also
Algebraic Number Fields · Quadratic Reciprocity · Dedekind Domains · Ideal Class Group · Pell Equation · Eisenstein Integers · Binary Quadratic Forms · Sums of Two Squares