Question about to_poly_solve



 Yes, it does call algsys, but usually the approximate methods end up
looking like decimals, I haven't noticed these fractions before.   I guess
I was just surprised that this particular one went crazy, since it ends up
being sin+cos=0 and cos-sin=1.  Thanks.


On Thu, Jun 13, 2013 at 10:25 AM, Stavros Macrakis <macrakis at alum.mit.edu>wrote:

> It looks like to_poly_solve is calling algsys, which is using approximate
> methods and thus giving bogus results.
>
> You might try:
>
>          sols: solve( [ trigexpand( sin(x)+cos(x)=cos(2*x) ),
> sin(x)^2+cos(x)^2=1 ], [sin(x),cos(x)] )
>
> To get explicit results (rather than sin(x)=...), you can then use %solve:
>
>           map(lambda([eq],%solve(eq,x)), sols);
>
>           -s
>
>
>
Essentially doing the same thing with directly gives me the following.  I
think I see what is happening here within Sage, thanks for the help.

(%i3) sols:solve(trigexpand( sin(x)+cos(x)=cos(2*x)),x);
(%o3)              [sin(x) = - cos(x), sin(x) = cos(x) - 1]
(%i6) load(to_poly_solve);

Loading maxima-grobner $Revision: 1.6 $ $Date: 2009-06-02 07:49:49 $
(%o6) /Users/.../sage-5.9.rc1/local/share/maxima/5.29.1/sha\
re/to_poly_solve/to_poly_solve.mac
(%i8) map(lambda([eq],%solve(eq,x)), sols);
                                               %pi
                                               --- - 4 %pi %z28
                                3 %pi           2
(%o8) [%union([x = 2 %pi %z26 + -----], [x = - ----------------]),
                                  4                   2
                                                                         %pi
                              %union([x = 2 %pi %z36], [x = 2 %pi %z38 -
---])]
                                                                          2



                                                                          2