Plotting a Fourier series.

Hello there.
I was given the task on trying to find a way to plot a Fourier series with n= 5, 10, 15 and so for f(x)= x. I know that this is not the most complicated thing to do but short of creating a numerous amount of functions each with a different Fourier coefficient and then plotting them all on the same graph I do not know how to do this. Can anyone help please?

Thank you very much.
Andrew.

Something like this:

f[x_] = x; 
fcap[0] = 
  With[{n = 0}, Integrate[f[t]/E^(I*n*t), {t, -Pi, Pi}]/(2*Pi)]; 
fcap[n_ /; n != 0] = 
  Simplify[Integrate[f[t]/E^(I*n*t), {t, -Pi, Pi}]/(2*Pi), 
       Element[n, Integers]]; 
partialSum[n_, x_] = 0 + Sum[2*Re[fcap[k]*E^(I*k*x)], {k, 1, n}]; 
Manipulate[Plot[partialSum[n, x], {x, -Pi, Pi}], {n, 0, 15, 1}]

Gianluca,

If I ever have the pleasure of meeting you in person… Please do not be offended if my first reaction is to just hug you and then kiss your forehead.

Thank you.

Sincerely,

Your soon to return customer,

Andrew.