Is there any procedure for determining if an infinite amount of solutions exist for an equation of the type $x^2 = ay^2 + byz + cz^2$ for arbitrary integer constants $a, b, c$ and variables $x, y, z \in \mathbb{Z_+}$? If not, does knowing at least one non-trivial solution of the equation help determine if an infinite amount of solutions exist?

Example (if it helps): let $x^2 = 202 y^2+14yz+9z^2$. Here one solution is $y=z=1$ and $x=15$, do there exist infinitely many other solutions?

  • $\begingroup$ Multiply your solution by any integer, and you'll get another solution. $\endgroup$ Nov 5, 2015 at 0:23
  • $\begingroup$ @IvanNeretin: Thanks, this appears to be true, but why? $\endgroup$
    – Sid
    Nov 5, 2015 at 0:29
  • $\begingroup$ Let $f(y,z) = 202y^2 + 14yz + 9z^2$. For any $p > q > 0$, we have $$(135p^2+96pq+135q^2)^2 = f(9(p^2-q^2),9p^2+90pq+23q^2)$$ This generate infinitely many solutions to the equation $x^2 = f(y,z)$. This is generated by your particular solution $(x,y,z) = (15,1,1)$ by looking at rational solutions of equations of the form $1 = f(\frac{1}{15} + t,\frac{1}{15} + st)$ with rational $s$ and then solve for $t$. $\endgroup$ Nov 5, 2015 at 1:39
  • $\begingroup$ @Sid: For your example (and others), yes, we can show there are not only infinitely many rational solutions, but there infinitely many positive integer ones. See answer below. $\endgroup$ Nov 5, 2015 at 2:03

7 Answers 7


TLDR; If there exists one nonzero solution, then there exist infinitely many solutions, paramatrized by $\Bbb{Z}^2$. Popular candidates to test are triplets $(0,y,z)$ where $y\mid c$ and $z\mid a$, though such solutions need not exist.

Every integral solution to your equation with $x\neq0$ yields a rational solution to \begin{equation}aY^2+bYZ+cZ^2=1,\end{equation} by setting $Y:=\tfrac yx$ and $Z:=\tfrac zx$. Conversely, every rational solution to this equation yields an integral solution to your equation by multiplying out the denominators. This also shows that multiplying an integral solution through by an integer yields another integral solution.

Given a nonzero rational solution $(Y_0,Z_0)$ to your equation, also $$(aY_0+bZ_0,-aZ_0),$$ is a rational solution, and moreover for every $k\in\Bbb{Z}$ also $$\left((aY_0+bZ_0)k^2+2cZ_0k-cY_0,-aZ_0k^2+2cY_0k+bY_0+cZ_0\right),$$ is a rational solution. These are in fact all rational solutions. This then in turn yields all integral solutions, except those with $x=0$. For these we have $$Y=\frac{-b\pm\sqrt{b^2-4ac}}{2a}Z,$$ so such solutions exist if and only if $\frac{-b\pm\sqrt{b^2-4ac}}{2a}$ are rational, i.e. if and only if $ax^2+bx+c$ has a rational root, which is easy to test.



$$ay^2 + by z + c z^2 = x^2\tag1$$

for the particular case when $z = 1$, and $a$ is not a square, then YES, given an initial positive integer solution, one can find an infinite more positive ones by solving a Pell equation. For your example,

$$202y^2 + 14y z + 9 z^2 = x^2\tag2$$

the solution is,

$$x = 15 + 418 p q + 6060 q^2$$

$$y = 1 + 30 p q + 418 q^2$$

$$z = 1$$

and $p,q$ solve,

$$p^2-202q^2 = 1$$

This is just a special case of a more general solution.


Alright, if $$ x = 87 u^2 + 116uv + 59 v^2, $$ also $$ y = uv + 4 v^2, $$ and $$ z = 29 u^2 + 34 u v + 3 v^2, $$ THEN $$ x^2 = 202 y^2 + 14 y z + 9 z^2. $$

This comes from a method in Fricke and Klein (1897) which is not widely known. By choosing $u,v$ positive you can get all three $x,y,z$ positive. It is also not so simple to find this sort of recipe. I wrote a program, here was the command:

 ./homothety_indef -1 202 9 14 0 0    0  7076 0 0 -7076 0   119

the output lines I used:

 87    116     59 transposed       87      0     29
  0      6      4 transposed      116      6     34
 29     34      3 transposed       59      4      3

? x = 87 * u^2 + 116 * u * v + 59 * v^2
%21 = 87*u^2 + 116*v*u + 59*v^2
? y = 6 * u * v + 4 * v^2
%22 = 6*v*u + 4*v^2
? z = 29 * u^2 + 34 * u * v + 3 * v^2
%23 = 29*u^2 + 34*v*u + 3*v^2
? 202 * y^2 + 14 * y * z + 9 * z^2
%24 = 7569*u^4 + 20184*v*u^3 + 23722*v^2*u^2 + 13688*v^3*u + 3481*v^4
? x^2
%25 = 7569*u^4 + 20184*v*u^3 + 23722*v^2*u^2 + 13688*v^3*u + 3481*v^4
? 202 * y^2 + 14 * y * z + 9 * z^2 - x^2
%26 = 0

The problem is solved definitely. Why is the question constantly recurs to me is not clear. Consider two options to solve this problem. The first option is to directly solve the equation without knowing whether there are solutions.


Solutions can be written if even a single root. $\sqrt{j(a+b+c)}$ , $\sqrt{b^2 + 4a(j-c)}$ , $\sqrt{b^2+4c(j-a)}$
Then the solution can be written.


$$+2(b+2c)(\sqrt{j(a+b+c)}\mp{j})sp+(j\mp \sqrt{j(a+b+c)})p^2$$




$$+2(b+2c) ( \sqrt{j(a+b+c)} \mp{j})sp + ( a + b + c \mp \sqrt{j(a+b+c)})p^2$$

In the case when the root $\sqrt{b^2+4c(j-a)}$ whole. Solutions have the form.






$$+2(4ac+b(2j-b)\pm {(b+2a)}\sqrt{b^2+4c(j-a)})sp+(b+2c\pm\sqrt{b^2+4c(j-a)})p^2$$

In the case when the root $\sqrt{b^2+4a(j-c)}$ whole. Solutions have the form.






$$+2((a+b+c)\sqrt{b^2+4a(j-c)}\mp{j(b+2a)})ps+ (b+2a\mp\sqrt{b^2+4a(j-c)})s^2$$

Since these formulas are written in general terms, require a certain specificity calculations.If, after a permutation of the coefficients, no root is not an integer. You need to check whether there is an equivalent quadratic form in which, at least one root of a whole. Is usually sufficient to make the substitution $X\longrightarrow{X+kY}$ or more $Y\longrightarrow{Y+kX}$ In fact, this reduces to determining the existence of solutions in certain Pell's equation. Of course with such an idea can solve more complex equations. If I will not disturb anybody, slowly formula will draw. number $p,s$ integers and set us. I understand that these formulas do not like. And when they draw - or try to ignore or delete. Formulas but there are no bad or good. They either are or they are not.

In equation $$aX^2+bY^2+cZ^2=qXY+dXZ+tYZ$$

$a,b,c,q,d,t - $ integer coefficients which specify the conditions of the problem. For a more compact notation, we introduce a replacement.

$$k=(q+t)^2-4b(a+c-d)$$ $$j=(d+t)^2-4c(a+b-q)$$ $$n=t(2a-t-d-q)+(2b-q)(2c-d)$$
Then the formula in the general form is:




$$+2((d+t-2c)\sqrt{k}\mp{ n })ps+(q+t+2(d-a-c)\pm\sqrt{k})s^2$$



And more.







$p,s - $ are integers and are given us. Since formulas are written in general terms, in the case where neither the root is not an integer, it is necessary to check whether there is such an equivalent quadratic form in which at least one root of a whole. If not, then the solution in integers of the equation have not.

  • $\begingroup$ Can you generalize this to higher exponents like x^8 etc? $\endgroup$
    – jmoore00
    Feb 4, 2019 at 5:16

The second option is if you know one any decision.

We need to write generally speaking the more General equation:


If we know what any one solution: $(x,y,z)$ - then you can write a formula for the solutions of this equation.




$k,t,s$ - any integer asked us.


I think one should first algebraically manipulate it into a form involving a linear equation in whole squares only:

$$ \begin{align} X ^2 &= a \cdot Y^2 + b \cdot YZ + c \cdot Z^2 \\ \to \\ \vdots \\ \to \\ a \cdot \Big[2X\Big]^2+(b^2-4ac)\cdot \Big[Z\Big]^2 &=\Big[2a \cdot Y+b \cdot Z\Big]^2 \\ \end{align} $$

Then use the time-honored methods of sterographic projection. This is an example.

For the equation $x^2 = 202 y^2+14yz+9z^2$, $a=202$, $b=14$, $c=9$, gives us in the whole-square equation:

$$808x^2-7076z^2=(404y+14z)^2$$ Reduces to $$1769z^2+(202y+7z)^2=202x^2$$

Though it looks daunting, you can find all solutions with the one already found by the OP


Equation Shown below has parametrization for $(a,b,c,d)=(6,-7,1,54)$

$dx^2=ay^2 + by z + c z^2$




For $k=0$ , we get $(x,y,z)=(7,1,55)$

  • $\begingroup$ It is useless to explain. The problem is formulated not so. And how much can you write numbers? It is necessary to solve the problem in the indeterminate coefficients. $\endgroup$
    – individ
    Jul 15, 2017 at 5:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .