Roots and periodicity of trigonometric functions

167 views
Skip to first unread message

dennis

unread,
Mar 8, 2012, 6:37:10 AM3/8/12
to sy...@googlegroups.com
Hi,

i am trying to find the roots of trigonometric functions such as sin(x), cos(x), ...

x = Symbol('x')
print( solve(sin(x), x) )
> [0]

Is there a way to get all roots of sin(x)? For example something like this:
> [pi*n]
or
> [0, pi], periodicity 2*pi


Sergiu Ivanov

unread,
Mar 8, 2012, 6:53:00 AM3/8/12
to sy...@googlegroups.com
Hello,

You may find this thread on-topic and, hopefully, helpful:

http://groups.google.com/group/sympy/browse_thread/thread/8440752be0ebea7b/f8f753539be410cd

I don't really possess the latest information on this issue, however,
so you may find it useful to wait for the developers to say their
word.

Sergiu

Aaron Meurer

unread,
Mar 8, 2012, 2:13:48 PM3/8/12
to sy...@googlegroups.com
For now, there's no easy way to get it. You can get at least some of
the solutions by adding 2*pi*n to the argument of the trig function:

In [5]: solve(sin(x + 2*pi*n), x)
Out[5]: [-2⋅π⋅n]

I don't know an easy way to get pi*n, though (in the general case).
This trick also works for more complicated functions:

In [19]: solve(sin(x + 2*pi*n) - cos(x + 2*pi*n), x)
Out[19]:
⎡π⋅(-8⋅n - 3) π⋅(-8⋅n + 1)⎤
⎢────────────, ────────────⎥
⎣ 4 4 ⎦

Aaron Meurer

> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/sympy/-/wVRK0SxmPiYJ.
> To post to this group, send email to sy...@googlegroups.com.
> To unsubscribe from this group, send email to
> sympy+un...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/sympy?hl=en.

Reply all
Reply to author
Forward
0 new messages