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.
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$