Solve the Diophantine equation
$$x^2+4y^2=z^2$$
The problem here is that I derived solutions using two different methods, and the both solutions do satisfy the given equation yet they are not the same! (1) and (2) is the way how I obtained solutions using different methods, and (3) deals with the core question I have. So if it's overwhelming somehow, then it would be glad if you could take a look at (3) at least.
(1) Using Graph
It is sufficient to find all rational solutions of equation
$$X^2 +4Y^2 =1:~X=\frac{x}{z}~\land~~Y=\frac{y}{z}$$
$Y=t(X+1)$ is a line which passes $(-1, 0)$ and another point $(m, n)$ with the slope $t$ on the equation above. By substituting the line equation to the equation above, we get
$$m=\frac{1-4t^2}{1+4t^2},~n=\frac{2t}{4t^2+1}$$
It is easy to show that $m, n \in \Bbb{Q}$ iff $t \in \Bbb{Q}$. Therefore, let $t=\frac{b}{a}$ where $(a, b)=1$. Then we get
$$m=\frac{a^2-4b^2}{a^2+4b^2},~n=\frac{2ab}{a^2+4b^2}$$
Therefore, let $(x, y, z)=(k(a^2-4b^2),~2kab,~k(a^2+4b^2))$. It is the solution for the very first Diophantine equation.
(2) Not Using Graph
It is easy to show that $x, z$ should have the same parity.
(i) When $z, x$ are odd, we have
$$4y^2=(z+x)(z-x)$$
Let $z+x=2u$ and $z-x=2v$. Since we are only interested in primitive solutions of the given equation, we can assume that $(z, x)=1$, then it is easy to show that $(u, v)=1$. Then we have
$$y^2=uv$$
Since $(u, v)=1$, let $u=a^2$ and $v=b^2$ where $(a, b)=1$. Then we have $y=ab,~x=a^2-b^2,~z=a^2+b^2$. Therefore, $(x, y, z)=(k(a^2-b^2),~kab,~k(a^2+b^2))$ is the solution for the very first Diophantine equation.
(ii) When $z, x$ are even, let $z=2z',~x=2x'$. Then we
$$x'^2+y^2=z'^2$$
Therefore, obviously $(x, y, z)=(4kab,~k(a^2-b^2),~2k(a^2+b^2))$ since $y$ should be odd in order to satisfy $(x, y, z)=1$.
(3) Summary
When we use graph, we get
$$(x, y, z)=(k(a^2-4b^2),~2kab,~k(a^2+4b^2))$$
If we don't use graph, we get
$$(x, y, z)=(k(a^2-b^2),~kab,~k(a^2+b^2)) ~\text{or}~ (4kab,~k(a^2-b^2),~2k(a^2+b^2))$$
This is really confusing. First thing is that anyway any of the solution does satisfy the Diophantine equation. Second, they are not the same. For example, in the soluton we obtained by graphical method $y$ should be always even. However, it is not required so in the latter solution. So I'm guessing the first solution is not denoting all the possible solutions of the equation. My question is... why? Since I did somewhat wrong or is it due to the imperfection residing in the graph itself? I don't get it...
Third, the answer in my book just says the all possible solutions are
$$(x, y, z)=(k(a^2-b^2),~kab,~k(a^2+b^2))$$
But it was the solution we obtained when $x, z$ were odd. Can we just replace it without adding another solution dervied when $x, z$ were even? Then why?
It is a long question, but I wanted to show every logic I used that has possibility of some flaws. Thanks.