Parameterizing a Diophantine Equation of Degree 2 I'm trying to solve a problem I found online and after fiddling around with the variables, I've arrived at the equation: $$x^2+x^2y^2+y^2=4z^2; 0 < x \le y; z \le 10^{10}$$
The problem asks for integral values $x$, $y$ and $z$, but the maximum value for $z$ is too large to try and test all possible combinations of $x$ and $y$.
I've coded something up to test the smaller values of $x$ and $y$ and, with the help of OEIS, have arrived at these:
$$x=2k; y = 8k^2; 1 \le k$$
$$x=8(k+1)^2; y = 2(k+1)(16k^2+32k+15); 0\le k$$
but these don't account for other values like $(x:112,y:418)$ and $(x:418,y:1560)$.
I've done some Googling too, which led me to Diophantine Equations entry on Wikipedia, but the parameterization guide lost me right after I've generated some non-trivial solutions for the equation.
Is there an equation or a set of equations to generate all possible values? If not, would more information help in getting the parameterizations?
Also, for future Diophantine equations, is there a rule of thumb or something I could attempt first to have the parameterizations?
 A: I'm not sure what you want to do with integrals but perhaps solutions for the individual variables might yield ideas. Given:
$$x^2+x^2y^2+y^2=4z^2$$
$$x = \frac{± \sqrt{4 z^2 - y^2}}{\sqrt{y^2 + 1}} \land y^2 + 1\ne0$$
$$y = \frac{± \sqrt{4 z^2 - x^2}}{\sqrt{x^2 + 1}} \land x^2 + 1\ne0$$
$$z =\frac{ ± \sqrt{x^2 (y^2 + 1) + y^2)}}{2}$$
The last equation looks like safest since it involves only sums under the radical and no danger of division by zero. Now, given $\quad (0<x<y)$:
$$z =\frac{ ± \sqrt{1^2 (2^2 + 1) + 2^2)}}{2}=\frac{\sqrt{3^2}}{2}$$
$$z =\frac{ ± \sqrt{1^2 (12^2 + 1) + 12^2)}}{2}=\frac{\sqrt{17^2}}{2}$$
$$z =\frac{ ± \sqrt{2^2 (3^2 + 1) + 3^2)}}{2}=\frac{\sqrt{7^2}}{2}$$
$$z =\frac{ ± \sqrt{2^2 (8^2 + 1) + 8^2)}}{2}=\frac{\sqrt{18^2}}{2}$$
$$z =\frac{ ± \sqrt{4^2 (32^2 + 1) + 32^2)}}{2}=\frac{\sqrt{132^2}}{2}$$
An interesting note is that whenever $y=x+1$ there is a perfect square under the radical.  This is just busywork math I'm offering but I hope, as I suggested above, that it may help with your ideas.
A: Consider the primitive solutions. For a given value of $x$, we need to solve the generalized Pell's equation $4z^2-(x^2+1)y^2=x^2$.
I don't have a proof yet. But from some results obtained via a python code, values of $x$ satisfies following recurrence.
$x(1)=2,x(2)=8,x(n)=4x(n-1)-x(n-2)$
There are few known algorithms for solving generalized Pell's equation. I guess it can be simplified further.
First few primitive triples are
(2, 8, 9)
(2, 144, 161)
(2, 2584, 2889)
(2, 46368, 51841)
(8, 30, 121)
(8, 546, 2201)
(8, 7742, 31209)
(30, 112, 1681)
(30, 28928, 434161)
(112, 418, 23409)
(418, 1560, 326041)
(1560, 5822, 4541161)
(5822, 21728, 63250209)
(21728, 81090, 880961761)

EDIT: Unfortunately, this doesn't generate all the solutions. Triple such as $(144, 9790, 704897)$ and $(546, 37120, 10133777)$ cannot be obtained by above method.
