Fwd: Trigonometric equations



You could try to_poly_solver:

load(to_poly_solver)$

eq: 2*cos(x)^2*x0-2*sin(x)*cos(x)*y0=x0$

sol: %solve(eq,x)

yields

%union(%if(%or(%i*y0-x0 # 0,%i*y0+x0 = 0),
           [x = -(%i*log(%i*y0/(%i*y0+x0)-x0/(%i*y0+x0))-4*%pi*%z8)/4],
           %union()),
       %if(%or(%i*y0-x0 # 0,%i*y0+x0 = 0),
           [x = -(%i*log(-sqrt(%i*y0/(%i*y0+x0)-x0/(%i*y0+x0)))
              -2*%pi*%z6)
              /2],%union()))$

which looks a bit daunting, but if you pull out the kernels e.g. k1:
part(sol,1,2,1,2) and change to trigonometric form using
ratsimp(rectform(k1)), you get

    (atan2(2*x0*y0/(y0^2+x0^2),(y0^2-x0^2)/(y0^2+x0^2))+4*%pi*%z8)/4

which isn't so bad, though Maxima should be able to simplify that to

    (atan2(2*x0*y0,(y0^2-x0^2))+4*%pi*%z8)/4

If you want only the base solution, you can set the parameter %z8 to 0 and
get

   atan2(2*x0*y0,(y0^2-x0^2))/4

There are some improvements we should make to Maxima to make all this less
painful, namely to do a better job of simplifying atan2 and to have rectform
understand %union and %if, but it does manage to solve the problem....

The user documentation for to_poly_solve is

  .../maxima/share/contrib/topoly-user-doc.html

where ... depends on the location of your Maxima.

Hope this helps,

              -s