I can't solve the following exercise. It's already on this site, but the solution method is not the same as in my solutions manual.
Find all solutions in positive integers of the Diophantine equation $x^2+2y^2 =z^2$.
The solution is given, but I do not understand the italicised parts.
13.1.8 $2y^2=z^2-x^2=(z-x)(z+x)$. $x$ and $y$ have the same parity, so $(z-x)/2$ and $(z+x)/2$ are integers. It suffices to assume $(x,z)=1$. Then either $((z-x)/2,z+x)=1$, and then $y^2=((z-x)/2)(z+x)=m^2n^2$, and solving $(z-x)/2=m^2$ and $z+x=n^2$ for $x$ and $y$ gives $x=(m^2-2n^2)/2,y=mn,z=(m^2+2n^2)/2$. Or $((z+x)/2,z-x)=1$ which gives $x=(2m^2-n^2)/2,y=mn,z=(2m^2+n^2)/2$.
Why have x and y the same parity?
Why are $(z-x)/2$ and $(z+x)/2$ integers?
Why do they assume $\gcd((z-x)/2,z+x)=1$ and next $\gcd((z+x)/2,z-x)=1$?
How to solve $(z-x^2)/2 = m^2$ and $z-x=n^2$ for x and y to become the values for x, y and z?
