We want to show that for any whole numbers p and q, such that p is larger than q, the three numbers: p2 – q2; 2pq; p2 + q2 form a Pythagorean triple. In other words, we need to show that the sum of the squares of the first two is equal to the square of the third. For this we use the general identities that hold for any a and b:
(a + b)2 = (a + b)(a + b) = a2 + ab + ba + b2 = a2 + 2ab + b2
(a – b)2 = (a – b)(a – b) = a2 – ab – ba + b2 = a2 − 2ab + b2.
Based on these identities, the square of the first number is:
(p2 – q2)2 = p4 − 2p2q2 + q4
and the sum of the first two squares is:
p4 − 2p2q2 + q4 + 4p2q2 = p4 + 2p2q2 + q4.
The square of the last number is:
(p2 + q2)2 = p4 + 2p2q2 + q4.
We therefore see that the square of the third number is indeed equal to the sum of the squares of the first two, irrespective of the values of p and q.