Elementary Number Theory – Derivation of Pythagorean Triple General Solution

diophantine equationselementary-number-theorypythagorean triples

I was reading on proof wiki about the derivation of the general solution to the pythagorean triple diophantine equation:
$$
x^2 + y^2 = z^2,
$$
where $x,y,z > 0$ are integers.
I came across the following general solution to the primitive function:
\begin{align*}
x &= 2mn\\
y &= (m^2 – n^2)\\
z &= (m^2 + n^2)\\
\end{align*}
for coprime $m,n$.

I looked at the proof of it working (if you square $x$ and $y$ and add it it does indeed equal $z^2$)

My one qualm was, how the hell did they start with that? For example, is there a natural way by starting with the original problem that you end up with the expression above?

I noticed that when attempting to derive the general solution myself, from start to finish,

I would begin by noting I can find all pairs such that $z$ and $y$ differ by a constant $k$… but I cannot make that final leap to end up with the equation above so that for any given $k$ you can find a solution.

Thanks ahead of time!

Best Answer

Consider the intersection of the line $y=t(x+1)$ with the circle $x^2+y^2=1$. We get points on the circle $$ (x,y)=\left(\frac{1-t^2}{1+t^2},\frac{2t}{1+t^2}\right). $$ Let $t=m/n$ be rational, plug into $x^2+y^2$ and clear denominators to get $$ (n^2-m^2)^2+(2mn)^2=(n^2+m^2)^2 $$

Related Question