# Thread: How to Plot a 'sum' function

1. ## How to Plot a 'sum' function

Hi all ,
I'm a newbie with the Mathematica program . I'm trying to draw the function in the photo .

N=10
-2<t<2

In the second image you can see what I wrote . nonetheless ,I got a message says: Syntax::sntxi: Incomplete expression; more input is needed.

What am I doing wrong ?

Thanks (:

2. Originally Posted by new guy
Hi all ,
I'm a newbie with the Mathematica program . I'm trying to draw the function in the photo .

N=10
-2<t<2

In the second image you can see what I wrote . nonetheless ,I got a message says: Syntax::sntxi: Incomplete expression; more input is needed.

What am I doing wrong ?

Thanks (:
Don't use brackets for the exponential. Just use parenthesis. Also, should specify explicitly the Re or Im component of the function like:

Code:
Plot[Re[Sum[E^(2*Pi*I*k*t),
{k, -10, 10}]], {t, -2, 2}]

3. Originally Posted by shawsend
Don't use brackets for the exponential. Just use parenthesis. Also, should specify explicitly the Re or Im component of the function like:

Code:
Plot[Re[Sum[E^(2*Pi*I*k*t),
{k, -10, 10}]], {t, -2, 2}]
It is already real, it just needs simplifying.

CB

4. First of all thank you both .

Second ,how do know that it needs to be Re and not Im ?

5. Originally Posted by new guy
First of all thank you both .

Second ,how do know that it needs to be Re and not Im ?
because if you pair terms with positve and negative indices of the same magnitude one is the conjugate of the other, and so such pairs have a real sum.

CB