Is there an algorithm to solve quadratic Diophantine equations?

If one is interested in efficient algorithms, as opposed to the simple existence of algorithms, it may be worth noting that, given positive integers $a$, $b$, and $c$, the question, are there positive integers $x$ and $y$ such that $ax^2+by=c$, is NP-complete. This is item AN8 in Garey and Johnson, page 250; the citation is Manders and Adleman, NP-complete decision problems for binary quadratics, J Comput System Sci 16 (1978) 168-184.


Sierpsinski proved that whenever this diophantine equation does not have a solution for $x$ then $x^2+(x+1)^2$ is prime. It is conjectured also by Sierpinski that there are infinitely many primes of the above form but this still remains open.

So, your question cannot be answered yet. For more details see http://arxiv.org/pdf/0810.0222.pdf


Let me just add that for solving quadratic diophantine equations in 2 variables, i.e. equations of the form $$ ax^2 + bxy + cy^2 + dx + ey + f = 0, \ \ a, b, c, d, e, f \in \mathbb{Z}, $$ there is a nice algorithm. Dario Alpern has created a website running a Java program which completely solves such equations for given coefficients $a, b, c, d, e$ and $f$ -- see http://www.alpertron.com.ar/JQUAD.HTM. Optionally, the program shows all steps of the solution, similar as a human might do when solving the equation by hand. The website also describes the algorithm used.