Quadratic Reciprocity
Quadratic residues, the Legendre symbol, and Gauss's golden theorem.
Quadratic reciprocity is one of the most celebrated theorems in all of mathematics — a precise and surprising law governing when integers are perfect squares modulo prime numbers. First conjectured by Euler and Legendre, and first proved by Carl Friedrich Gauss in 1796, the law reveals a deep symmetry hidden inside the structure of the primes, connecting seemingly unrelated questions about remainders into a single elegant statement. Gauss himself called it the theorema aureum — the golden theorem — and he returned to it throughout his life, eventually publishing eight distinct proofs.
Quadratic Residues and the Legendre Symbol
The story begins with a simple question: given a prime and an integer not divisible by , does the congruence have a solution? An integer with is called a quadratic residue modulo if such a solution exists, and a quadratic non-residue if it does not. Among the nonzero residue classes modulo , exactly half are quadratic residues and half are non-residues. This follows from the fact that the squaring map on the cyclic group is a two-to-one function: every quadratic residue has exactly two square roots modulo , namely and , which are distinct because is an odd prime.
To streamline calculations, Adrien-Marie Legendre introduced an elegant piece of notation in his 1798 Essai sur la théorie des nombres. The Legendre symbol is defined for an odd prime and an integer with by:
and we extend the convention by setting when .
The Legendre symbol is not just a notational convenience — it satisfies a set of powerful algebraic properties that make it genuinely useful for computation. The most fundamental of these is Euler’s criterion, which provides an explicit formula: for an odd prime and ,
Since by Fermat’s Little Theorem, the quantity satisfies , so it must be congruent to either or . Euler’s criterion says it equals precisely when is a quadratic residue. This criterion also makes plain that the Legendre symbol is completely multiplicative: since , we have
Two special cases of the Legendre symbol are important enough to be called the first and second supplements to quadratic reciprocity. The first supplement tells us when is a quadratic residue:
This recovers Fermat’s theorem that an odd prime is representable as a sum of two squares if and only if — a result whose full proof uses Gaussian integers and connects quadratic residues to Diophantine equations. The second supplement concerns :
So is a perfect square modulo exactly when is congruent to or modulo . Together, these two supplements and the main reciprocity law give us a complete toolkit for evaluating any Legendre symbol.
The Law of Quadratic Reciprocity
With the Legendre symbol in hand, we can state the law of quadratic reciprocity, the crown jewel of classical number theory. Let and be distinct odd primes. The law asserts:
In words: the product of the two Legendre symbols and equals if and only if both and are congruent to modulo ; otherwise it equals . Equivalently, unless both and , in which case .
The surprise here is genuine: whether is a square modulo appears, at first glance, to have nothing to do with whether is a square modulo . These are questions about entirely different modular systems. The law of quadratic reciprocity says that these two questions are deeply linked — one almost entirely determines the other, with the only exception arising from the arithmetic of the primes modulo .
To see the law in action, consider whether is a quadratic residue modulo . By reciprocity, since but , we get . Now , so . Since , the second supplement gives . Therefore , and indeed confirms that is a square mod .
Gauss was seventeen years old when he discovered this theorem and nineteen when he published his first proof in the Disquisitiones Arithmeticae of 1801. That monumental treatise, written while he was a student at the University of Göttingen, organized and advanced virtually all of number theory known at the time. The Disquisitiones contains Gauss’s first proof of quadratic reciprocity by induction on the primes. Over the following decades he published seven more proofs, approaching the theorem from algebra, analysis, combinatorics, and geometry. By now, over 200 proofs of quadratic reciprocity are known, making it one of the most-proved theorems in mathematics.
Among the classical proofs, Gauss’s lemma gives a particularly illuminating approach. Consider the integers modulo . Reduce each to a representative in the range . Let be the number of these representatives that are negative. Then . When applied to , Gauss’s lemma translates the Legendre symbol into a count of lattice points — specifically, into counting integer points in a rectangle, establishing a geometric interpretation of the reciprocity law. This lattice-point proof, sometimes called Eisenstein’s proof after its popularization by Gotthold Eisenstein in the 1840s, is arguably the most elegant of the elementary approaches.
Gauss sums provide another route, connecting reciprocity to analysis. The quadratic Gauss sum is defined as
A direct computation shows , so or depending on modulo . By considering the product and relating it to through character theory, one obtains quadratic reciprocity as a consequence of the multiplicativity of Gauss sums — a proof that opens the door to vast generalizations.
Higher-Order Residues and Power Reciprocity
Quadratic reciprocity raises an obvious question: what happens if we replace squares with cubes, or with higher powers? An integer is an -th power residue modulo if has a solution. By an argument analogous to the quadratic case, is an -th power residue if and only if (assuming , so that the relevant structure exists).
To formulate higher reciprocity laws cleanly, it becomes necessary to move beyond the integers . Cubic reciprocity is most naturally stated not in but in the ring of Eisenstein integers , where is a primitive cube root of unity. Gauss observed this, and Eisenstein proved cubic reciprocity in 1844: for “primary” Eisenstein primes and (primary being an analogue of the condition for ordinary primes),
where denotes the cubic residue symbol, defined analogously to the Legendre symbol but now taking values in .
Similarly, biquadratic (quartic) reciprocity is naturally formulated in the Gaussian integers , the ring generated by adjoining to . Gauss proved this law in 1832 (with a full proof not published until posthumously). The quartic residue symbol takes values in , the fourth roots of unity. The pattern is clear: the -th power reciprocity law lives most naturally in the ring , where is a primitive -th root of unity.
This insight is the seed of an enormous generalization. Émil Artin proved the Artin reciprocity law in 1927, a far-reaching theorem that simultaneously generalizes all previously known reciprocity laws — quadratic, cubic, quartic, and beyond — into a single unified statement about abelian extensions of number fields. Artin reciprocity is the central theorem of class field theory, which classifies all abelian Galois extensions of a number field in terms of arithmetic data intrinsic to the field itself. From this altitude, quadratic reciprocity is a special case of a much larger architecture: the beginning of the Langlands program, which seeks to extend these ideas to non-abelian Galois groups.
The Gauss sums and Jacobi sums that appear in proofs of quadratic reciprocity generalize naturally to this setting. For a Dirichlet character modulo , the Gauss sum encodes crucial analytic information. The Jacobi sum relates these sums multiplicatively and connects them to counting points on algebraic curves over finite fields — a bridge between number theory and algebraic geometry that would be fully developed only in the twentieth century.
The Jacobi Symbol and Generalizations
Evaluating Legendre symbols requires knowing whether is prime, and when is large, this can be expensive. The Jacobi symbol is an extension of the Legendre symbol designed to make computation more efficient, even when the denominator is not prime.
For an odd positive integer and an integer with , the Jacobi symbol is defined as the product of Legendre symbols:
The Jacobi symbol is also when . It inherits multiplicativity from the Legendre symbol: and . Crucially, the Jacobi symbol satisfies its own reciprocity law: for odd positive coprime integers and ,
along with the supplements and .
The key caveat is that does not imply that is a quadratic residue modulo . When is composite, the Jacobi symbol can equal even when no solution to exists — because the Legendre symbols for the individual prime factors could all be , canceling in pairs. For example, , yet has no solution. Thus the Jacobi symbol gives a necessary but not sufficient condition for quadratic residuosity when the denominator is not known to be prime.
Despite this limitation, the Jacobi symbol is immensely useful algorithmically. Computing using the reciprocity law and the supplements requires only the prime factorization of and repeated applications of the Euclidean algorithm — no factorization of is needed. This leads to an efficient algorithm, running in time, for evaluating the Jacobi symbol. The algorithm closely parallels the Euclidean algorithm: repeatedly replace with (after correcting signs using the reciprocity law), reducing both entries until the symbol is trivially evaluated.
The Kronecker symbol extends the Jacobi symbol further to all integers, including even denominators and negative integers. For , one sets if and if . For , one sets if is even, if , and if — matching the second supplement of quadratic reciprocity. This extension allows the Kronecker symbol to appear in the theory of quadratic forms: if is a fundamental discriminant, then the function is a Dirichlet character, and the corresponding L-function governs the distribution of primes represented by quadratic forms with discriminant .
The Jacobi and Kronecker symbols are not merely computational tools — they are the bridge between quadratic reciprocity and the modern theory of Dirichlet characters and L-functions. The quadratic character is among the simplest Dirichlet characters, and studying its associated L-function already reveals deep phenomena: the class number formula connects the special value to the number of equivalence classes of binary quadratic forms with discriminant . Gauss’s work on quadratic forms — which fills much of the Disquisitiones Arithmeticae — was thus, in retrospect, an early chapter in the story of L-functions and class field theory.
The reciprocity laws surveyed here — quadratic, cubic, quartic, and Artin’s general law — represent one of the great arcs of mathematical development over three centuries. Beginning with Euler’s empirical observations about squares modulo primes in the 1740s, passing through Legendre’s formulation and Gauss’s proofs, continuing through the work of Eisenstein and Kummer on higher reciprocity and algebraic integers, and culminating in Artin’s class field theory and ultimately in the Langlands program, the question of which integers are perfect powers modulo which primes has driven the creation of algebraic number theory, class field theory, and the search for a unified theory of arithmetic. Every generalization has required new mathematical structures — Gaussian integers, Eisenstein integers, rings of algebraic integers, abelian extensions, automorphic representations — and the pattern continues: the non-abelian analogues of reciprocity remain among the deepest open problems in mathematics today.