Skip to main content
AMC 10 & 12

Quadratic Diophantine Equations

Pythagorean triples and sums of two squares — integer solutions to equations one degree past linear.

Pythagorean triples

Every primitive Pythagorean triple (integer sides with gcd(a,b,c)=1\gcd(a,b,c)=1) can be generated from a pair of integers m>n>0m > n > 0, coprime and of opposite parity:

a=m2n2,b=2mn,c=m2+n2a = m^2-n^2, \qquad b = 2mn, \qquad c = m^2+n^2

Every other Pythagorean triple is just an integer multiple of a primitive one — this is why triples like 6-8-10 and 9-12-15 are all built from the primitive 3-4-5.

Sums of two squares

A key factoring identity: a2b2=(a+b)(ab)a^2-b^2=(a+b)(a-b) turns a difference of squares into a product, which is often the entry point for these problems. A deeper fact governs which integers can be written as a sum of two squares: a positive integer nn is expressible as a sum of two squares if and only if every prime factor of nn that is 3(mod4)\equiv 3 \pmod4appears to an even power.

Worked example

Problem: Find all primitive Pythagorean triples with hypotenuse 25.

Solution: We need m2+n2=25m^2+n^2=25 with m>n>0m>n>0, coprime, opposite parity. Testing: m=4,n=3m=4, n=3 gives 16+9=2516+9=25 ✓ (coprime, opposite parity).

This generates the triple:

a=m2n2=169=7,b=2mn=24,c=25a=m^2-n^2=16-9=7, \qquad b=2mn=24, \qquad c=25

So the triple is (7,24,25)(7, 24, 25) — and this is the only primitive triple with hypotenuse 25 (the other decomposition, 25=52+0225=5^2+0^2, fails since it requires n>0n>0).

Practice problems

1.Using m=3,n=2m=3, n=2, generate a primitive Pythagorean triple.

2.Is 21 expressible as a sum of two squares? (21=3×721=3\times7)

3.Is 45 expressible as a sum of two squares? (45=32×545=3^2\times5)

4.Solve x2y2=15x^2-y^2=15 in positive integers, using the factoring identity.