Quadratic reciprocity and its applications
Reduce square-solvability questions between odd primes while tracking the sign and the two supplementary laws.
On this page
The question for today
What you’ll understand
- State reciprocity for distinct odd primes with its sign condition.
- Use the supplementary laws for negative one and two.
- Evaluate a Legendre symbol through factorization, reduction, and justified swaps.
The question whether one prime is a square modulo another seems to depend on a long table of residues. Quadratic reciprocity reveals a relation when those two primes exchange roles. A sign correction is essential: the two answers agree unless both primes are three modulo four. Along with simple rules for negative one and two, the theorem turns many large square-status questions into small ones. This lesson practices the theorem carefully and explains what the reduction does and does not deliver.
Swap the primes while preserving the sign
For distinct odd primes p and q, multiply the two Legendre symbols obtained by exchanging numerator and denominator. Reciprocity says that this product is negative one precisely when p and q are both three modulo four, and positive one otherwise. Since neither symbol is zero in the distinct-prime case, this determines either symbol from the other. If the primes are equal, both original symbols are zero and this formula does not apply.
The theorem is much deeper than the arithmetic rules that implement it. One way to understand the source of the sign uses Gauss’s lemma: multiply the lower-half residues by a numerator and count how often their least positive representatives fall in the upper half. That count determines the Legendre symbol’s sign. Comparing the two counts for p and q yields a lattice-point parity relation. We use reciprocity as a proved theorem here, rather than pretending a few examples establish it.
Handle signs and powers of two separately
The numerator negative one is a square exactly when p is one modulo four. This follows directly from Euler’s criterion. The numerator two has symbol one when p is one or seven modulo eight and negative one when p is three or five modulo eight. These are supplementary laws, not cases obtained by treating two or negative one as odd primes in reciprocity. Their separate hypotheses keep a symbol calculation well defined.
To evaluate a general numerator, first reduce it modulo the prime denominator, then factor it into a sign, powers of two, and odd prime factors. Use multiplicativity to separate the factors. Every even exponent contributes one provided the prime denominator does not divide that factor. A zero factor gives symbol zero immediately. Apply reciprocity only to the remaining odd prime factors, and reduce the new numerators after each swap.
A reduction algorithm needs an audit trail
Write every swap with its sign before simplifying residues. This prevents a common error: reducing the new numerator correctly but losing the minus sign when both primes are three modulo four. The denominator usually becomes smaller after a swap and reduction, giving an efficient descent toward a small symbol. For a composite numerator, factorization or the more general Jacobi-symbol algorithm can organize the work, but the Legendre definition still requires a prime denominator.
A final symbol of negative one proves that a square congruence has no solution. A symbol of one proves existence, not the roots themselves, and it is not a primality certificate for the denominator. In an equation over integers, finding a modular obstruction can disprove integer solvability, while absence of one chosen obstruction cannot prove solvability. Distinguishing these logical directions makes reciprocity useful in Diophantine reasoning without asking the theorem to establish more than it says.
Work it through
Use two swaps and preserve both signs
Evaluate the Legendre symbol (19/43) and decide whether x² ≡ 19 modulo 43 is solvable.
Both 19 and 43 are three modulo four, so reciprocity gives (19/43) = −(43/19). Reduce 43 modulo 19 to obtain (19/43) = −(5/19).
The prime 5 is one modulo four, so the next swap has positive sign: (5/19) = (19/5) = (4/5). The residue four is a nonzero square modulo five, so this last symbol is one.
Retain the minus sign from the first swap. The original symbol is negative one, which proves that no residue x modulo 43 can have square 19.
The symbol (19/43) is −1, so the square congruence has no solution modulo 43.
The living notebook
Explore the model
Interactive lab · function
A square value and a solvability question
At coefficient a = one, compare positions x = −2, zero, and two, predicting their quadratic heights before moving the control. The real curve shows squaring and its sign symmetry, but every nonnegative real has a real root. Modular square membership is a separate finite arithmetic question; the lab cannot evaluate a Legendre symbol or demonstrate reciprocity.
- y at chosen x
- 0.608
- Tangent slope · 2ax
- 1.35
- Signed area · ax³/3
- 0.182
This lab uses only y = ax². Playback traces the curve within the fixed integration interval from 0 to x; it does not estimate numerical error or change the chosen point. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forUse a visualization to identify the operation, then use the theorem and its hypotheses to decide finite-field solvability.
Pause & reason
Check your understanding
Your turn
Try it yourself
Evaluate (7/29) using reciprocity, and separately evaluate (2/29). Explain what each answer says about roots.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
The prime 29 is one modulo four. For the numerator two, use its own modulo-eight law instead of an odd-prime swap.
Compare with the solution
Reciprocity introduces no sign because 29 is one modulo four. Thus (7/29) = (29/7) = (1/7) = 1, so x² ≡ 7 has two roots modulo 29, although this calculation does not construct them. Since 29 is five modulo eight, the supplementary law gives (2/29) = −1, so x² ≡ 2 has no roots modulo 29. A separate check finds 6² ≡ 7, giving roots 6 and 23 for the first congruence.
Keep the idea
Take it with you
- Quadratic reciprocity swaps distinct odd primes with a precisely determined sign.
- Negative one and two obey supplementary laws with their own conditions.
- Legendre-symbol calculations decide existence of modular square roots, not their construction or integer solvability.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.