proof of Pythagorean triplet

Consider the 4AB=(A+B)2-(A-B)2. Assume that A,B are coprimeMathworldPlanetmath. (This is no : If d is the greatest common divisorMathworldPlanetmath of A,B, then one can write A=dA,B=dB to get 4d2(AB)2=d2((A+B)2-(A-B)2) and cancel d2.)

For 4AB,A+B,A-B to form a Pythagorean tripleMathworldPlanetmath, each of A,B must be squares. So A=m2,B=n2 where m,n are coprime, n<m. So we have

a=2mn,b=m2-n2,c=m2+n2 (1)

and {a,b,c} are a Pythagorean triple. But this needn’t be primitivePlanetmathPlanetmath: If m,n are odd, then 2m2±n2, so not all of a,b,c are relatively prime.

Suppose 2mn,m2-n2,m2+n2 are pairwise coprime. Then gcd(2mn,m2+n2)=gcd(2mn,(m+n)2)=1=gcd(2mn,(m-n)2), and it follows that gcd(2mn,m+n)=1,gcd(2mn,m-n)=1. Thus gcd(2,m+n)=1, i.e. m±n is odd. Furthermore, gcd(2mn,m+n)=1 implies gcd(m,n)=1. And since the sum/differencePlanetmathPlanetmath of two integers is odd iff one is even, and the other is odd, only one of m,n is odd. Thus, gcd(m2-n2,m2+n2)=gcd(m2+n2,2n2)=1. Conversely, if m,n are coprime, and exactly one of m,n is odd, then gcd(2,m±n)=1; thus, 2mn,m2-n2 are coprime. From the fact that gcd(a+b,a-b)=gcd(a,b) if a,b have opposite parity and gcd(m2,n2)=1 it follows that m2-n2,m2+n2 are also coprime. And since gcd(2mn,m2+n2)=gcd(2mn,(m+n)2) and gcd(2mn,m+n)=1 it follows that 2mn,m2+n2 are coprime. So the conditions the Pythagorean triple {2mn,m2-n2,m2+n2} is primitive, gcd(2mn,m+n)=1 and m,n are coprime and exactly one of them is odd are equivalentMathworldPlanetmathPlanetmathPlanetmathPlanetmath.

So if a,b,c satisfy a2+b2=c2 and a,b,c are pairwise coprime, then c is odd, and exactly one of a,b are odd and the other is even.

Let n,m be coprime positive integers of opposite parity, n<m. Set

n=m+n,m=n-m (2)

in equation 1 gives

b=mn,c=n2+m22=m2+n22,a=n2-m22 (3)

since n=m+n2, m=n-m2. Clearly, gcd(m,n)=1.

Now we prove that any primitive Pythagorean triple can be generated choosing odd coprime integers.

Remark 1.

Let m,n be odd coprime integers, n<m. Let f1=n2-m22,f2=n2+m22. Then gcd(f1,f2)=1.


Since gcd(n2,m2)=1=gcd(f1+f2,f1-f2), the statement follows from the fact that f1,f2 have opposite parity since in this case gcd(f1,f2)=gcd(f1+f2,f1-f2). Since 4n2-m2, f2 is odd, and since f1=f2+n2 and n is odd, f1,f2 have opposite parity. ∎

Substituting C=n2, B=m2 in BC=(C+B2)2-(C-B2)2 yields that mn,n2-m22,n2+m22 is a primitive Pythagorean triple.

To see that any primitive Pythagorean triple is of this form:

Theorem 1.

Let a,b be positive coprime integers satisfying a2+b2=c2. Then a,b have opposite parity, and c is odd. Furthermore (a,c)=(b,c)=1.


a,b cannot both be even since gcd(a,b)=1. If both a,b were odd we had c22(mod4) which is impossible since the square of any number is either congruentMathworldPlanetmathPlanetmath ( 0 or 1 modulo 4. Thus, c must be odd. Now for any integers a,b the congruence a2+b2(a+b)2(mod2) holds. Together with c21(mod2) this gives a+b1(mod2), so a,b have opposite parity. ∎

Suppose a is odd. Since a2=(c+b)(c-b) is a square, and (c+b,c-b)=(c+b,2b) and (2,c+b)=1 it follows that c±b are coprime and consequently each of them is square. This gives c-b=n2,c+b=m2 where m,n are odd coprime integers, and we get

a2=m2n2 (4)
a = mn, (5)
b =(c+b-(c-b))/2 =m2-n22, (6)
c =n2+m22. (7)

Now let A=ab2 be a square. Without loss of generality we can set a=mn, b=n2-m22 where m,n are odd coprime integers. So we have A=mnn2-m24, and since mn and n2-m24 are coprime, each of them must itself be a square. So we have

c2=(n2+m22)2=(mn)2+(n2-m22)2 (8)

where the right-hand side numbers are biquadratic integers. So the question if the area of a right triangleMathworldPlanetmath with integer sides is square is equivalent to asking if x4+y4=z2 has a solution in positive integers.

Title proof of Pythagorean triplet
Canonical name ProofOfPythagoreanTriplet
Date of creation 2013-03-22 14:06:52
Last modified on 2013-03-22 14:06:52
Owner Thomas Heye (1234)
Last modified by Thomas Heye (1234)
Numerical id 12
Author Thomas Heye (1234)
Entry type Proof
Classification msc 11D09
Related topic ContraharmonicMeansAndPythagoreanHypotenuses