Does the inverse of Euclids Pythagorean equation hold?

I know that one can generate many Pythagorean triples $(A,B,C)$, where $C^2=A^2+B^2$ with Euclid's formula: $C=X^2+Y^2$, $A=X^2-Y^2$, and $B=2 X Y$.

Euclid's formula can find all primitive Pythagorean triples using suitable values for $X$ and $Y$, as well as numerous others using arbitrary choices for $X$ and $Y$, but I know that it won't find them all. But I am wondering if in certain cases, whether or not this relationship will still hold in reverse when it comes to certain triangle dimensions.

In particular, if one has a right angle triangle with all integer length sides, and the hypotenuse can be described as the sum of two square integers, does that mean that the other two sides will be equal to the difference of those two squares, and twice the product of the two integers, per Euclid's formula?

• Actually, your formula does generate all Pythagoren triples. – user99680 Jun 28 '14 at 8:01
• @user99680: It doesn't, try $9,12,15$. – André Nicolas Jun 28 '14 at 8:13
• @Mark: Well, $C$ could be the sum of two squares in more than one way. – André Nicolas Jun 28 '14 at 8:24
• $10^2+5^2=100+25=125=121+4=11^2+2^2$ now the only primitive pytagorean triple with hypotenuse $125$ is $(44,117,125)$ according wiki en.wikipedia.org/wiki/Pythagorean_triple – user126154 Jun 28 '14 at 9:18
• Note that the "bad" $C$ (the ones that are hypotenuses, but that the formula leaves out) are the $C$ that have a prime factor $p$ of the form $4k+3$ occurring to an odd power. So $C=10$ is good, $C=15$ bad, $C=45$ good, $C=135$ bad, $C=35$ bad, $C=105$ bad. – André Nicolas Jun 28 '14 at 16:13