# How to print out Maxima commands being used by Sage?

The documentation says that solve_ineq is implemented with Maxima fourier_elim. I am trying to figure out why the output below of Sage and Maxima are different. Is there a way I can have Sage print out the exact Maxima commands it issued to try to understand why I'm not getting the same result as from Using Maxima directly?

sage: x,y = var('x,y')
sage: solve_ineq([x^2*y^2 <= x^2*y, x^2*y^2 > x^2*y],[x,y])
[[x == 0, 1 < y, 0 != 0], [x == 0, y < 0, 0 != 0]]

(%i2) fourier_elim([x^2*y^2 <= x^2*y, x^2*y^2 > x^2*y],[x,y]);
(%o2)                              emptyset

edit retag close merge delete

Sort by » oldest newest most voted

Sage sets the domain of all variables to complex when initializing Maxima. You can get the same result as Sage by doing this manually on the Maxima prompt:

\$ ./sage -maxima
Maxima 5.26.0 http://maxima.sourceforge.net
using Lisp ECL 11.1.1
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) domain: complex;
(%o1)                               complex
(%o2) /home/burcin/sage/sage-5.5.rc0/local/share/maxima/5.26.0/share/contrib/f\
ourier_elim/fourier_elim.lisp
(%i3) fourier_elim([x^2*y^2 <= x^2*y, x^2*y^2 > x^2*y],[x,y]);
(%o3)           [x = 0, 1 < y, 0 # 0] or [x = 0, y < 0, 0 # 0]


If you want to take a look at the code, Maxima initialization is done at the beginning of sage/interfaces/maxima_lib.py. Line 141 has the default options set by Sage.

more

Can you have a look at ticket 14229 where I have put up a patch to potentially remove such vacuous solutions? Are there cases where the patch could fail, or give wrong answers? It passes all doctests in sage/symbolic.