Prove that if x2 + y2 = z2
with x,y,z integer that a p and q integer can be found such that
x=2pq , z = p2 + q2 and y = p2 - q2
We can assume that (x,y,z) = 1 because if not the common factors can be divided out.
So (x,y)=1 , (x,z)=1 and (y,z)=1.
Now because x and y has no common factors , both cannot be even.
So either both be odd or one even and the other odd.
Let us now assume that both x and y is odd. If so then z is even. So z = 2n , z2 = 4n2
Therefore 4 divides z2. If this is so then 4 must also divide x2 + y2
Because x odd we have x == (1 or 3)mod4 , so x2 ==(1 or 9)mod4 , so x2 ==1mod4
Because y odd we also have y2==1mod4
Therefore x2 + y2 == 2 mod 4 , so 4 does not divide x2 + y2 and we have
a contradiction and our assumption that both x and y is odd must be wrong.
So x is even and y is odd.
We can therefore write x2 = (z-y)(z+y)
We see that x is even. Now if z-y and z+y has common factors then
so must their sums and differences also have the same common factors.
The sum is 2z and the difference is 2y. But (z,y)=1 so the only common factor is 2.
We can therefore write z+y = 2r and z-y=2s where (r,s)=1
So x2 = 4rs , but x2 is square and the product of r and s must therefore also be square.
However because r and s have no common factors they themselves must be squares.
So we have r = p2 and s = q2
Therefore x2 = 4 p2q2 , so x = 2pq
We also have that 2z = 2r + 2s , so z = r + s = p2 + q2
In the same way we get 2y = 2r - 2s , so y = r -s = p2 - q2
Done.
Example : 42 + 32 = 52
So 2r = 8 and 2s = 2
So r = 4 and p=2
So s=1 and q=1
This gives x = 4 = 2pq = 2x2x1
Also z = p2 + q2 = 22 + 12 = 4+1 = 5
Also y = p2 - q2 = 22 - 12 = 4-1 = 3
End