Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to plot the Fourier sine series for $f(x) = x$.

I would like to manipulate the parameter n from $0$ to $10$ and plot the sine waves over $(0,1)$. My code below does not work; what is wrong?

Manipulate[Plot[FourierSinSeries[x, x, n], {x, 0, 1}], {n, 0, 10}]
share|improve this question
Tried adding Evaluated -> True to Plot[]? – J. M. May 6 '13 at 4:29
Also, for this function, n cannot be zero, so you'll need to change {n,0,10} to {n,1,10}. If you only intended to plot for integer n, then it's {n,1,10,1} – bill s May 6 '13 at 5:07
up vote 3 down vote accepted

As per the comment:

Manipulate[Plot[Evaluate[FourierSinSeries[x, x, n]], {x, 0, 10}], {n, 1, 10}]

What is happening here is that Plot has the attribute HoldAll so that the FourierSinSeries function has not been evaluated (at the points n) when the plot occurs. There are some examples of this in the documentation for Plot: for instance look at the Neat Example and try removing the Evaluated command -- the plot will disappear.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.