An example problem in my textbook asks: Find all solutions in positive integers of the diophantine equation $x^2 + 2y^2 = z^2$. The provided proof appears as follows:
$2y^2 = z^2 - x^2 = (z - x)(z + x)$. $x$ and $z$ have the same parity, so $(z - x)/2$ and $(z + x)/2$ are integers. It suffices to assume $(x, z) = 1$. Then either $(\frac{(z - x)}{2}, z + x) = 1$, and then $y^2 = \frac{(z - x)}{2}(z + x) = m^2n^2$, and solving $\frac{(z - x)}{2} = m^2$ and $z + x = n^2$ for $x$ and $y$ gives $x = (n^2 - 2m^2)=2, y = mn, z = \frac{(n^2 + 2m^2)}{2}$.
Or $(\frac{(z + x)}{2}, z - x) = 1$, which gives $x = (2m^2 - n^2)=2$, $y = mn$, $z = \frac{(2m^2 + n^2)}{2}$.
Several parts of this proof confuse me. For one, why does it suffice to assume $(x, z) = 1$? Second, if we do assume this, then why does it follow that either $(\frac{(z - x)}{2}, z + x) = 1$ or $(\frac{(z + x)}{2}, z - x) = 1$?