Ask Your Question
2

using 'solve' with trigonometric functions

asked 2015-11-30 05:37:07 +0100

drJ gravatar image

updated 2015-11-30 08:16:33 +0100

slelievre gravatar image
solve(tan(3*x)==1, x, to_poly_solve='force', explicit_solutions=True)

fails to produce answers while

solve(sin(3*x)==1, x, to_poly_solve='force', explicit_solutions=True)

works as expected

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2015-11-30 14:57:46 +0100

kcrisman gravatar image

updated 2015-11-30 16:41:15 +0100

As a partial workaround,

sage: solve(tan(x)==1,x,to_poly_solve='force')
[x == 1/4*pi + pi*z35]

though it does take longer than I would have expected.

In Maxima, we get the following which Sage doesn't currently translate, I think.

(%i5) load(to_poly_solve);

Loading maxima-grobner $Revision: 1.6 $ $Date: 2009-06-02 07:49:49 $
(%o5) /Users/.../sage-6.9/local/share/maxima/5.35.1/share/t\
o_poly_solve/to_poly_solve.mac
(%i6) %solve(tan(3*x)=1,x);
                      2 %pi (12 %z11 + 1)
(%o6) %union(%if(3 tan (-----------------) - 1 # 0, 
                               12
                      %pi
       - 2 %pi %z11 - ---
                       6
[x = - ------------------], %union()), 
               2
         2                        2 %pi       2 %pi
%if(3 tan ((4 %pi %z7 - %i log(sin (---) + cos (---))
                                    12          12
                             %pi                      %pi
           (sqrt(3) + 1) sin(---) + (sqrt(3) - 1) cos(---)
                             12                       12
 + 2 atan(-------------------------------------------------) + 2 %pi)/4) - 1 # 
                            %pi                        %pi
          (sqrt(3) - 1) sin(---) + (- sqrt(3) - 1) cos(---)
                            12                         12
                                %pi        %pi                %pi        %pi
                    sqrt(3) sin(---)   sin(---)   sqrt(3) cos(---)   cos(---)
                                12         12                 12         12   2
0, [x = - (%i (log((---------------- + -------- + ---------------- - --------)
                           3/2            3/2            3/2            3/2
                          2              2              2              2
                %pi        %pi                %pi        %pi
    sqrt(3) sin(---)   sin(---)   sqrt(3) cos(---)   cos(---)
                12         12                 12         12   2
 + (---------------- - -------- - ---------------- - --------) )/2
           3/2            3/2            3/2            3/2
          2              2              2              2
                         %pi        %pi         %pi        %pi
                     sin(---)   cos(---)    cos(---)   sin(---)
                         12         12          12         12
            sqrt(3) (-------- + --------)   -------- - --------
                     sqrt(2)    sqrt(2)     sqrt(2)    sqrt(2)
            ----------------------------- - -------------------
                          2                          2
 + %i (atan(---------------------------------------------------) + %pi))
                         %pi        %pi         %pi        %pi
                     sin(---)   cos(---)    sin(---)   cos(---)
                         12         12          12         12
            sqrt(3) (-------- - --------)   -------- + --------
                     sqrt(2)    sqrt(2)     sqrt(2)    sqrt(2)
            ----------------------------- - -------------------
                          2                          2
                                      2
 - 2 %pi %z7)/2], %union()), %if(3 tan ((4 %pi %z9
                            %pi                      %pi
          (sqrt(3) - 1) sin(---) + (sqrt(3) + 1) cos(---)
                            12                       12
 + 2 atan(-----------------------------------------------)
                            %pi                      %pi
          (sqrt(3) + 1) sin(---) + (1 - sqrt(3)) cos(---)
                            12                       12
             2 %pi       2 %pi
 - %i log(sin (---) + cos (---)))/4) - 1 # 0, 
               12          12
                               %pi        %pi                %pi        %pi
                   sqrt(3) sin(---)   sin(---)   sqrt(3) cos(---)   cos(---)
                               12         12                 12         12   2
[x = - (%i (log((- ---------------- + -------- - ---------------- - --------)
                          3/2            3/2            3/2            3/2
                         2              2              2              2
                  %pi        %pi                %pi        %pi
      sqrt(3) sin(---)   sin(---)   sqrt(3) cos(---)   cos(---)
                  12         12                 12         12   2
 + (- ---------------- - -------- + ---------------- - --------) )/2
             3/2            3/2            3/2            3/2
            2              2              2              2
                           %pi        %pi         %pi        %pi
                       sin(---)   cos(---)    cos(---)   sin(---)
                           12         12          12         12
              sqrt(3) (-------- + --------)   -------- - --------
                       sqrt(2)    sqrt(2)     sqrt(2)    sqrt(2)
 + %i atan2(- ----------------------------- - -------------------, 
                            2                          2
      %pi        %pi                 %pi        %pi
  sin(---)   cos(---)            sin(---)   cos(---)
      12         12                  12         12
  -------- + --------   sqrt(3) (-------- - --------)
  sqrt(2)    sqrt(2)             sqrt(2)    sqrt(2)
- ------------------- - -----------------------------)) - 2 %pi %z9)/2], 
           2                          2
%union()))
edit flag offensive delete link more

Comments

thank you @kcrisman

drJ gravatar imagedrJ ( 2015-11-30 18:29:58 +0100 )edit

Indeed, this seems to be more or less the same as http://trac.sagemath.org/ticket/14736

kcrisman gravatar imagekcrisman ( 2015-11-30 19:51:29 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2015-11-30 05:37:07 +0100

Seen: 742 times

Last updated: Nov 30 '15