summation for the sines of angles in A.P

47 views
Skip to first unread message

Gaurav Dhingra

unread,
Jan 4, 2015, 5:43:32 AM1/4/15
to sy...@googlegroups.com

I came across something which i think should have been solved by sympy:

> from sympy import 
> x, y, z = symbols('x y z')
> n, N = symbols('n N', integer=True)
> summation(sin(n
x), (n, 1, N))
Sum(sin(n*x), (n, 1, N))         # so it returns the expression as it is


 

I expected the answer to be a piece-wise function, what's the catch in this ?

Aaron Meurer

unread,
Jan 4, 2015, 2:41:56 PM1/4/15
to sy...@googlegroups.com
This is the answer, according to Wolfram Alpha http://www.wolframalpha.com/input/?i=sum(sin(n*x)%2C+(n%2C+1%2C+N))&dataset=. I guess the value at 0 has to be taken as a limit. 

The Sum means that SymPy can't do it. SymPy doesn't have the algorithms to compute this summation. Its summation algorithms are not particularly strong. There are classes of summations that it can compute, and this apparently isn't in one of them. 

Aaron Meurer

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/bf7ddc6d-485a-4bf4-92a9-4c26ad02180b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gaurav Dhingra

unread,
Jan 5, 2015, 5:03:51 AM1/5/15
to sy...@googlegroups.com
I think however in the case:
 when x==0 then the value of sin(n*x) == 0 for all value of n(n==1, 2, 3, ....) so x==0 should not be in the case of taking limits of the function, rather its value should be zero(without limits).

And i want to know that since "Sympy" can not solve bcz of not available algorithms in it. Is this considered a "bug" (in precise terms) ?

Gaurav Dhingra
Reply all
Reply to author
Forward
0 new messages