Question: Symbolic summation gives wrong result?

Hi,

I have encountered some strange issue with symbolic summation. Would be grateful for any help.

Here is the code (inserted as image):

Symbolic summation of powers of sines & cosines

 

Code in text:

restart;
F:=(n,a,b)->sum(r^(a+b)*cos(2*Pi/n*j+t)^a*sin(2*Pi/n*j+t)^b,j=0..n-1);

F(n,2,2);
F(4,2,2); 

The issue is that symbolic summation produces the formula (for general n) which contradicts the particular case (n=4).

Could somebody explain why this is happening? Is it a bug or am I missing something here?

I have tried all versions of Maple downto 14 - same situation.
Also Mathematica givers the same answer.

Thank you in advance,
Pavel Holoborodko.

--
Multiprecision Computing Toolbox
http://www.advanpix.com/

Please Wait...