# Second degree Diophantine equations

I found a question whether there are general methods to solve second degree Diophantine equations. I was unable to find an answer so is this known? In particular, the original writer wants to know whether one can find all integers satisfying $x^2 + x = y^2 + y + z^2 + z$.

-
For your equation, as was explained by Will Jagy, this is equivalent to looking for all the odd solutions of $X^2+1=Y^2+Z^2$. There are various parametric families of solutions. I have seen a nicer collection somewhere (Piezas?) but here is a start. –  André Nicolas Aug 11 '12 at 20:20

About algorithm: There is an algorithm that will determine, given any quadratic $Q(x_1,\dots,x_n)$ as input, whether or not the Diophantine equation $Q(x_1,\dots,x_n)=0$ has a solution. This is something that I (and others) observed quite a long time ago. I have no knowledge about a nice algorithm.

Set one machine $M_1$ to search systematically for solutions. Another machine $M_2$ simultaneously checks whether there is a real solution (easy) and then checks systematically for every modulus $m$ whether there is a solution modulo $m$.

By the Hasse Principle (which in this case is a theorem), if our equation has "local" solutions (real and modulo $m$ for every $m$) then it has an integer solution. So either $M_1$ will bump into a solution or $M_2$ will find a local obstruction to a solution. Thus the algorithm terminates.

The corresponding question for cubics is unsolved. The same question for quartics (in arbitrarily many variables) is equivalent to the general problem of testing a Diophantine equation for solvability, so is recursively unsolvable.

Added: I think that the details are written out in the book Logical Number Theory I by Craig Smorynski. Very nice book, by the way.

-
do you mean $Q=0?$ –  Will Jagy Aug 11 '12 at 20:17
@WillJagy: Yes. Thank you for pointing out the typo. –  André Nicolas Aug 11 '12 at 20:23
So there are only finitely many $m$'s to be checked? If I remember correctly, Turing machine should halt after finitely many steps for every input. –  Jaakko Seppälä Aug 11 '12 at 20:29
The machines $M_1$ and $M_2$ operate in parallel (or equivalently make a single $M$ that alternates between an $M_1$ computation and an $M_2$ computation.) As soon as we find an integer solution we halt. As soon as we find an obstruction $m$ (no solution mod $m$) we halt. So for any input $Q$, the algorithm halts in finite time. The time will depend on $Q$. –  André Nicolas Aug 11 '12 at 20:36