Generating Pythagorean triples

elementary-number-theorypythagorean triples

I'm asked to generate Pythagorean triples from the polynomial identity:

$$(X^2-1)^2 + (2X)^2=(X^2+1)^2$$
By substituting rational numbers $\frac p q$ for $X$. However, Pythagorean triples are just as the name says, it, three numbers. If I would substitute this number I get:
$$(\left(\frac p q\right)^2-1)^2 + 4\left(\frac p q\right)^2=(\left(\frac p q\right)^2+1)^2$$

How would I get three integers from this? There are just two numbers involved, $p$ and $q$.

Best Answer

It should be $$(p^2-q^2)^2+(2pq)^2=(p^2+q^2)^2,$$ where $p$ and $q$ are natural numbers such that $p>q$, $\gcd(p,q)=1$ and $p$ and $q$ have different parity.

Now, you can get all triples: $(d(p^2-q^2),d(2pq),d(p^2+q^2)),$ where $d$ is a natural number.

Related Question