Solving a simple equation

33 views
Skip to first unread message

Robert Samal

unread,
Mar 27, 2012, 10:38:37 AM3/27/12
to sage-s...@googlegroups.com
Hi,

I'm sorry if this is covered somewhere in the documentation -- but I'm puzzled by the following behaviour of solve:

sage: solve(sin(x)/cos(x)==1,x)
[sin(x) == cos(x)]
sage: solve(tan(x)==1,x)      
[x == 1/4*pi]

I would assume these two equation are equivalent, but evidently sage disagrees. Who is right? :-)
What can I do to get the solution automatically, without substituting tan manually?

Thanks,
 Robert Samal


Jason Grout

unread,
Mar 27, 2012, 10:42:37 AM3/27/12
to sage-s...@googlegroups.com

How about

solve(sin(x)/cos(x)==1,x,to_poly_solve=True)

http://aleph.sagemath.org/?z=eJwrzs8pS9UozszTqNDUT84vBlK2toY6FTol-fEF-TmV8cUgBbYhRaWpmgBdMw-x

That gives the general solution, if the z... variable is an integer.

Jason

Reply all
Reply to author
Forward
0 new messages