I want to find the non-negative integer solutions of the diophantine equation $$x^2+2y^2=z^2 \ \ \ \ , \ \ \ \ \gcd(x,y,z)=1$$
It holds that $(x,y)=(y,z)=(x,z)=1$.
That's what I have tried:
$$2y^2=z^2-x^2=(z-x)(z+x)$$
$$2 \mid (z-x)(z+x) \Rightarrow (z-x)(z+x)=2k, k \in \mathbb{Z}$$
Let $(z-x,z+x)=d>1$
Then $d$ has a prime divisor, let $p$.
$p \mid d, d \mid z-x, d \mid z+x \Rightarrow p \mid z-x \text{ and } p \mid z+x \Rightarrow p \mid 2z \text{ and } p \mid 2x \Rightarrow p \mid 2(x,y)=2 \Rightarrow p=2$
So: $$2 \mid z-x \Rightarrow z-x=2x_1, x_1 \in \mathbb{Z}$$
$$2 \mid z+x \Rightarrow z+x=2z_1, z_1 \in \mathbb{Z}$$
So $2y^2=2x_1 \cdot 2z_1 \Rightarrow y^2=2x_1 z_1$.
So it has to hold $x_1=2l, z_1=l, l \in \mathbb{Z}$.
So $z=x+2x_1=x+4l \text{ and } z=2x_1-x=4l-x \Rightarrow x+4l=4l-x \Rightarrow x=0$.
$$z=4l$$
$$y=2l$$
Could you tell me if it is right?