# The diophantine equation $z^2=a^2+bx^2+cy^2$

Is there a way to obtain (enumerate) the integer solutions $(x,y,z)$ of the following quadratic Diophantine equation

$z^2=a^2+bx^2+cy^2$

where $a$ is an integer and $b, c$ are positive integers? I have checked the literature on Diophantine equations but could not find anything useful. Any help or suggestions would be greatly appreciated.

I think you can at first solve the well known equation w^2 + a^2 = z^2 for convenient values of a and go after to the equation w^2 = bx^2 + cy^2 which is solved in the book of L. J. Mordell “Diophantine Equations” (Academic Press. London and New York, 1969 page 44).

We have at least two, $(0,0,a)$ and $(0,0,-a).$

We have infinitely many solutions to $$b x^2 + c y^2 - z^2 = -a^2.$$

It is possible, however, that no solutions need be primitive: under some choices of $a$ it may be that all solutions have $x,y,z$ all divisible by $a.$ An early example of this (not quite the pattern your form takes) is due to C. L. Siegel, see pages 168 and 253 in CASSELS.

Actually, an easy example is given by $$3 x^2 + 3 y^2 - z^2 = -9.$$ We see immediately that $z^2$ is divisible by $3,$ therefore $z$ is divisible by $3.$ As a result, $3x^2 + 3 y^2$ is divisible by $9,$ so that $x^2 + y^2$ is divisible by $3.$ Since Legendre symbol $(-1|3) = -1,$ we see that $x,y$ are also both divisible by $3.$

Find a solution ( the smallest one with $u,v > 0$ is best) to $u^2 - b v^2 = 1.$ We can now replace any of the solutions we have found so far with $$(x,y,z) \mapsto (ux+vz,y, bvx+uz).$$

Find a solution ( the smallest one with $p,q > 0$ is best) to $p^2 - c q^2 = 1.$ We can replace any of the solutions we have found so far with $$(x,y,z) \mapsto (x,py+qz, cqy+pz).$$