0

Suppose $A,B,C$ are integers. When does the equation $$ Ax^2+By^2+Cz^2=0$$ have a nontrivial solution in integer $x,y,z$?

I don't need all solutions, or even one solution, I just want to know if a solution exists. Specifically, I want an algorithm that is practical for small $A,B,C$.

I believe Lagrange did something with this, but there are so many results with his name that I haven't been able to find it. Thanks.

1 Answers1

4

Theorem (Lagrange): Let $a,b,c$ be squarefree (positive) pairwise coprime integers. Then $ax^2+by^2=cz^2$ has a nontrivial rational or integral root if and only if $$ \left(\frac{bc}{a}\right)=\left(\frac{ac}{b}\right)=\left(\frac{-ab}{c}\right)=1, $$
where this should mean that $bc$ is a quadratic residue modulo $a$, etc. (it is better to use the notation $bc\, \square \, a$, $ac\, \square \, b$ and $-ab\, \square \, c$).

For, say, the example $5x^2+7y^2=13z^2$ we have $$ \left(\frac{7\cdot 13}{5}\right)=\left(\frac{5\cdot 13}{7}\right)=\left(\frac{-5\cdot 7}{13}\right)=1 $$ so that there is a nontrivial integer solution. For further references, also on this site, see here:

Clarification of Legendre's theorem re: $ ax^2+by^2=cz^2$

Note that there are versions with the wrong sign, see Will's correction!

Solutions to $ax^2 + by^2 = cz^2$

Dietrich Burde
  • 140,055
  • Thanks, but Will's answer on that page gives the example of $5x^2+41y^2-21z^2$ which satisfies those conditions but has no solutions. The problem is that the Jacobi symbol does not identify quadratic residues if the denominator is not prime. It seems that this link given by Will has the correct answer. – Brendan McKay Feb 19 '23 at 11:51
  • @BrendanMcKay Yes, the "symbol" is not the Jacobi symbol in general, but should rather be written $bc , \square , a$ etc. But it is a convenient "notation" of what you have linked. – Dietrich Burde Feb 19 '23 at 12:39
  • Ok, but the Jacobi symbol for non-prime denominator has a standard definition which is not this. So it is best to avoid this notation. Also, it is still wrong. Consider $a=9,b=-1,c=1$. It has solutions such as $x=5,y=9,z=12$, but $bc$ is not a quadratic residue mod $a$. You need $a,b,c$ to be square-free as well. – Brendan McKay Feb 19 '23 at 12:52
  • @BrendanMcKay Alright, I have added it. Your initial question was to find the right result among the many results by Legendre. I suppose you now know which result of Lagrange is meant and you can fill in the necessary details (and the notation you prefer). So what about your second question - you wanted "an algorithm that is practical for small $a,b,c$"? Here I found an article by Cremona, and a paper by Holzer, saying that one only needs to check a rather small range of integers by computer, to answer the existence question. – Dietrich Burde Feb 19 '23 at 14:25