Is there a tool for solving systems of quadratic Diophantine equations?

I know that satisfiability of such equations is undecidable in general, but I still hope that in simple cases software could decide (in particular if a solution exists).

I tried the online Wolfram Alpha and indeed, "solve x^2+y^2=10 over the integers" finds a solution, but "solve x^2+y^2=25 over the integers" already fails.

  • $\begingroup$ my favorite is this site. it gives you everything, just the solutions, step by step solutions and even the theory behind it if you click on methods ( left hand side right above the date). alpertron.com.ar/QUAD.HTM $\endgroup$ – user25406 Jan 5 '17 at 14:40
  • $\begingroup$ Thanks, but does it work for more variables and more equations? $\endgroup$ – Peter Franek Jan 5 '17 at 14:42
  • $\begingroup$ it works for general quadratic equations. ax^2 + bxy + cy^2 + dx + e*y + f = 0. you may want to try it for you case and see what you get. (keep in mind that your equation should be written as x^2+y^2-10) and the coefficients b,d,e must be entered as 0. $\endgroup$ – user25406 Jan 5 '17 at 14:46

Wolfram Alpha utilized Wolfram Mathematica for questions like that and it can certainly solve your question (once you learn the syntax).

You can try it using Wolfram's Programming Lab. The interface/notation is the same as Mathematica uses but it has some limitations (it is free compared to the price of Mathematica) as far as how long/many calculations you can do.

Follow the link them down the bottom click on Create a New Notebook>

Then type in the following Mathematica command:


It will give you all 12 solutions.

Breaking down this command it is made up of several parts which will let you answer similar questions.

  • Solve[] - takes too inputs - an equation or list of equations then a variable or list of variables to solve for. A list is created by putting things in curvy brackets { and }.

  • Element[] - tells Mathematica that the first argument is of type given by the second argument. For your case Integers will be all you need but Mathematica can work on a variety of types.

So basically its solve three equations/conditions. Firstly $x^2+y^2==10$ (Note the double equal sign for comparing equality. A single equal side is for assigning a variable.) The second and third are the conditions we require, i.e. that $x$ and $y$ are integers. These are all encases in curvy brackets to make them a list of equations. Then there is the list (also in curvy brackets) of variable, i.e. $\{x,y\}$.

Mathematica and Wolfram's Programming Lab can do *lots* of mathematical calculations but learning the language/syntax can be a bit of a steep learning curve. The Programming Lab does have built in help in the top right corner so have fun.

| cite | improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.