TITLE: $x^2+y^2=2z^2$, positive integer solutions
QUESTION [5 upvotes]: Determine all positive integer solutions of the equation $x^2+y^2=2z^2$.
First I assume $x \geq y$, and I have $x^2-z^2=z^2-y^2$. Then I have $(x-z)(x+z)=(z-y)(z+y)$, but from here, I don't know how it can help me to describe solutions (I know that there are infinitely many).

REPLY [3 votes]: Though others have posted simple solutions to the problem but if you want to proceed the way you did then here it is:
First let $\dfrac xz = a$ and $\dfrac yz = b$. This reduces problem to two variables (which are rational numbers).
Now we have $(b+1)(b-1)=(1+a)(1-a)$
which means $${b+1\over1+a} ={ 1-a\over b-1}$$
Let this fraction be $\dfrac mn$ in reduced form. From this we get 2 linear equations in 2 variables (in terms of a and b). 
Solving those will give
$$a = \frac{(n² + 2mn - m²)}{(m² + n²)}$$
$$b = {(m² + 2mn - n²)\over(m² + n²)}$$
 Substituting values of a and b back gives the solution to original problem:
$$x = n² + 2mn - m²$$ $$y = m² + 2mn - n²$$ $$z = m² + n²$$