Lost solutions in to_poly_solve
(%i1) eq:sin(2*x)=cos(x);
(%o1) sin(2*x)=cos(x)
(%i2) eq1:trigexpand(eq);
(%o2) 2*cos(x)*sin(x)=cos(x)
Lost solutions:
(%i3) to_poly_solve([eq], [x]);
Loading maxima-grobner $Revision: 1.6 $ $Date: 2009/06/02 07:49:49 $
(%o3) %union([x=-(4*%pi*%z0+%pi)/2],[x=(4*%pi*%z1+%pi)/6])
Correct:
(%i4) to_poly_solve([eq1], [x]);
(%o4) %union([x=2*%pi*%z15-%pi/2],[x=2*%pi*%z17+%pi/2],
[x=2*%pi*%z19+%pi/6],[x=2*%pi*%z21+(5*%pi)/6])
In to_poly_solve equation is not equivalent to
lhs(equation)-rhs(equation)=0.
For example:
(%i1) eq:sin(2*x)=cos(x);
(%o1) sin(2*x)=cos(x)
(%i2) to_poly_solve([eq], [x]);
Loading maxima-grobner $Revision: 1.6 $ $Date: 2009/06/02 07:49:49 $
(%o2) %union([x=-(4*%pi*%z0+%pi)/2],[x=(4*%pi*%z1+%pi)/6])
(%i3) to_poly_solve([lhs(eq)-rhs(eq)=0], [x]);
(%o3) %union([x=2*%pi*%z15-%pi/2],[x=2*%pi*%z17+%pi/2],[x=2*%pi*%z19+%pi/6],[x=2*%pi*%z21+(5*%pi)/6])
The solution sets are the same. To see this, solve sin(2x) = cos(x), and replace the arbitrary integer in the solution with 3k, 3k+1, and 3k+2.