Solve equations integrally

asked 2012-10-28 22:29:29 +0200

Doubtless Lee gravatar image

Is it possible to solve polynomial equations over the integers in Sage?

For example, I want to find the integral solutions of x*y + y*z + z*x = 7 and x + y + z = 5. One possible solution is [x = 1, y = 1, z = 3], and there are only finitely many. Geometrically, I want to obtain the rational points on the intersection of a quadratic hypersurface and a couple of hyperplanes.

After some testing I have come to the conclusion that Maple cannot do this, but Mathematica does seem to be able to produce those solutions. However, I'm new to Sage and don't know if this is within its reach.

I would be very grateful for your help

edit retag flag offensive close merge delete


I don't believe Sage can do what you're asking, at least not out of the box without you coming up with your own algorithm. There are a few questions about this already, but I think this is the best explanation is here:

David Ferrone gravatar imageDavid Ferrone ( 2012-11-03 12:10:02 +0200 )edit

If it were a polynomial in one variable you could use roots() and tell it to consider the integers ZZ. (e.g. )

David Ferrone gravatar imageDavid Ferrone ( 2012-11-03 12:16:28 +0200 )edit