Skip to content

Quadratic Reciprocity

The theory of quadratic residues asks a fundamental question:

The Central Problem

The theory of quadratic residues asks a fundamental question:

Given distinct odd primes pp and qq, when does the congruence

x2q(modp) x^2\equiv q\pmod p

have a solution?

Equivalently, when is

(qp)=1? \left(\frac{q}{p}\right)=1?

At first glance, the residue behavior of qq modulo pp and the residue behavior of pp modulo qq appear unrelated. The law of quadratic reciprocity reveals a remarkable symmetry between them.

This theorem is one of the deepest and most beautiful results in elementary number theory.

Statement of the Law

Theorem (Quadratic Reciprocity). Let pp and qq be distinct odd primes. Then

(pq)(qp)=(1)p12q12. \left(\frac{p}{q}\right) \left(\frac{q}{p}\right) = (-1)^{\frac{p-1}{2}\frac{q-1}{2}}.

(pq)(qp)=(1)p12q12 \left(\frac{p}{q}\right)\left(\frac{q}{p}\right)=(-1)^{\frac{p-1}{2}\frac{q-1}{2}}

Equivalently,

$$ \left(\frac{p}{q}\right)

\left(\frac{q}{p}\right) $$

unless both pp and qq are congruent to

3(mod4). 3\pmod4.

If both are congruent to 3(mod4)3\pmod4, then

$$ \left(\frac{p}{q}\right)

-\left(\frac{q}{p}\right). $$

Thus the residue relationship between two primes is almost symmetric.

First Examples

Consider p=3p=3 and q=11q=11.

Since

33(mod4),113(mod4), 3\equiv3\pmod4, \qquad 11\equiv3\pmod4,

quadratic reciprocity predicts

$$ \left(\frac{3}{11}\right)

-\left(\frac{11}{3}\right). $$

Now

112(mod3), 11\equiv2\pmod3,

and 22 is not a square modulo 33. Hence

$$ \left(\frac{11}{3}\right)

\left(\frac{2}{3}\right) =-1. $$

Therefore

(311)=1. \left(\frac{3}{11}\right)=1.

Indeed,

52=253(mod11). 5^2=25\equiv3\pmod{11}.

So 33 is a quadratic residue modulo 1111.

A Symmetric Example

Now take

p=13,q=17. p=13, \qquad q=17.

Since

131(mod4), 13\equiv1\pmod4,

quadratic reciprocity gives

$$ \left(\frac{13}{17}\right)

\left(\frac{17}{13}\right). $$

Reducing modulo 1313,

174(mod13). 17\equiv4\pmod{13}.

Since

22=4, 2^2=4,

we have

(413)=1. \left(\frac{4}{13}\right)=1.

Therefore

(1317)=1. \left(\frac{13}{17}\right)=1.

Hence 1313 is a quadratic residue modulo 1717.

Supplementary Laws

Quadratic reciprocity is accompanied by two supplementary laws describing the symbols for 1-1 and 22.

First Supplementary Law

$$ \left(\frac{-1}{p}\right)

(-1)^{(p-1)/2}. $$

Thus:

p(mod4)p \pmod4(1p)\left(\frac{-1}{p}\right)
1111
331-1

So 1-1 is a quadratic residue modulo pp exactly when

p1(mod4). p\equiv1\pmod4.

Second Supplementary Law

$$ \left(\frac{2}{p}\right)

(-1)^{(p^2-1)/8}. $$

Thus:

p(mod8)p \pmod8(2p)\left(\frac{2}{p}\right)
1,71,711
3,53,51-1

Together, these formulas allow efficient computation of Legendre symbols.

Computational Strategy

Quadratic reciprocity reduces complicated symbols to simpler ones.

Suppose we wish to compute

(101383). \left(\frac{101}{383}\right).

Since

1011(mod4), 101\equiv1\pmod4,

we may reverse the symbol without changing sign:

$$ \left(\frac{101}{383}\right)

\left(\frac{383}{101}\right). $$

Reducing modulo 101101,

38380(mod101). 383\equiv80\pmod{101}.

Factor:

80=245. 80=2^4\cdot5.

Thus

$$ \left(\frac{80}{101}\right)

\left(\frac{2}{101}\right)^4 \left(\frac{5}{101}\right). $$

Since the fourth power is 11,

$$ \left(\frac{80}{101}\right)

\left(\frac{5}{101}\right). $$

Reciprocity and reduction continue until only small symbols remain.

This process resembles the Euclidean algorithm and makes quadratic residue computations practical even for large primes.

Gauss and the Theory of Congruences

Quadratic reciprocity was first conjectured by entity[“people”,“Leonhard Euler”,“Swiss mathematician”] and entity[“people”,“Adrien-Marie Legendre”,“French mathematician”], but the first rigorous proof was given by entity[“people”,“Carl Friedrich Gauss”,“German mathematician”].

Gauss called it the “fundamental theorem” of arithmetic modulo primes.

He later discovered several different proofs. Over time, mathematicians found hundreds of proofs using methods from:

  • elementary number theory,
  • algebra,
  • finite fields,
  • Fourier analysis,
  • geometry,
  • topology,
  • algebraic number theory.

The theorem became a gateway to modern reciprocity laws.

Structural Meaning

Quadratic reciprocity reveals that quadratic residue behavior is not random. The solvability of

x2p(modq) x^2\equiv p\pmod q

is closely connected to the solvability of

x2q(modp). x^2\equiv q\pmod p.

This hidden symmetry reflects deeper algebraic structures inside number fields.

Modern reciprocity laws generalize quadratic reciprocity to higher powers and more general fields. These generalizations eventually lead to class field theory and the Langlands program.

Thus quadratic reciprocity stands at the beginning of one of the main structural themes of modern number theory.