Just the animation, this code is slightly different than the final version:
Animate[
Plot[{x(1-x),
8/Pi^3 Sum[
Sin[n Pi x]/n^3, {n, 1, a, 2}]},
{x, -.2,1.2}, PlotRange -> {-.2, .3}],
{a, 1, 5, 2}]
Begin Post:
The first thing to do is to graph $x(1-x)$ which is a parabola of height $1/2$ and intercepts at $0,$ and $1$.
Plot[x (1 - x), {x, -.2, 1.2}, PlotRange -> {-.2, .5}]
Noitice how similar this looks to $sin(\pi x)$. Since Fourier series are made out of $sin$ we expect a very good approximation.
We then want to stack the Fourier series onto this image, but we also want to animate it. Lets worry about the Fourier series before the animation.
The method I used was first defining the individual terms $u_n$ and then using the Sum command. It will help us to define the individual terms so we can look at each one separate from the series as a whole.
fourierTerms[n_, x_] = 8/Pi^3 Sin[(2 n + 1) Pi x]/(2 n + 1)^3;
series[a_,x_]:=Sum[fourierTerms[n,x],{n,0,a,1}]
Why don't we check to see this is what we expect. Lets graph the first 3 terms.
Plot[{
fourierTerms[0, x],
fourierTerms[1, x],
fourierTerms[2, x]},
{x, -.2, 1.2}, PlotRange -> {-.2, .3}]
Good, this makes sense. Now that we have everything we can toss an animate around it and go!
Note we only used the first 3 terms because the approximation is so good we don't really need any more.
Animate[
Plot[
{x (1 - x),
series[a, x]},
{x, -.2, 1.2}, PlotRange -> {-.2, .3}],
{a, 0, 2, 1}
]
Tada!