# Proof that the sum of the even side and the hypotenuse of a coprime (and positive) Pythagorean triple is a square number [duplicate]

I wish to prove that for any coprime (and positive) Pythagorean triple $(x,y,z)$, where $x$ is even, $x+z$ is always a square number.

By inspection, this appears true; $(3,4,5)$ gives $9$, $(5,12,13)$ gives $25$, $(8,15,17)$ gives $25$, $(7,24,25)$ gives $49$ et cetera. Yet I am stuck on the proof.

I do not know the original source of the problem.

• All Pythagorean triples can be generated by choosing integer values for $a$ and $b$ and substituting them into \begin{eqnarray*} x=a^2-b^2 \\ y=2ab \\ z =a^2+b^2 \end{eqnarray*} Aug 24, 2017 at 20:40
• I think this is only true for primitive triples. (12, 16, 20) is a counterexample. It comes out of Euclid's formula. en.wikipedia.org/wiki/Pythagorean_triple Aug 24, 2017 at 20:40
• OP did say "coprime", which is the same as primitive. Aug 24, 2017 at 20:45
• @martycohen Pretty sure that 'coprime' wasn't there before... Aug 24, 2017 at 20:47
• @Bram28: You may be right. I find it annoying when a question is edited to fix an error and the change is not mentioned. Aug 24, 2017 at 21:12

## 2 Answers

For every Pythagorean triple $(x,y,z)$, with $d=\gcd(x,y,z)$;
there are coprime integers $a,b$ with different pairity, such that:
$$x=d(a^2-b^2) \ \text{and} \ y=d(2ab) \ \text{and} \ z=d(a^2+b^2);$$

Now notice that the coprime condition implies $d=1$; so we have the following:

$$(2ab)+(a^2+b^2)=(a+b)^2.$$

Note that $(m^2+n^2)^2=(2mn)^2+(m^2-n^2)$. Since $2mn$ is always even, we have $m^2+n^2+2mn=(m+n)^2$.

As @shuri pointed out, in $(3,4,5)$, $4+5=9$ which is a perfect square. But when you do not include your coprime condition, we can multiply all the elements of triplet by an even number say $2,4$ etc to get $(x,y,z)$ of same parity and then one pair give us a perfect square $m^2+n^2+2mn$ while other one give us twice of a perfect square $(2m^2)$.