The Delta Function
In[32]:=
Clear[a0,a,b,Sn]
In[33]:=
a0=1/(2 Pi)Integrate[DiracDelta[x],{x,-2 Pi,2 Pi}]
a[n_]:=1/Pi Integrate[DiracDelta[x]u[x,Pi,n],{x,-2 Pi,2 Pi}]
Table[a[k],{k,1,6}]
b[n_]:=1/Pi Integrate[DiracDelta[x]v[x,Pi,n],{x,-2 Pi,2 Pi}]
Table[b[k],{k,1,6}]
Out[33]=
1 ---- 2 Pi
Out[34]=
1 1 1 1 1 1
{--, --, --, --, --, --}
Pi Pi Pi Pi Pi Pi
Out[35]=
{0, 0, 0, 0, 0, 0}
This gives the partial sums of the akCos[kPi x/Pi] ( akCos[kx] ) from 1 to 10 (we'll have to add the a0 term later). Note the bk are zero! Be prepared to wait.
In[36]:=
Sn=Table[Sum[a[k]u[x,Pi,k],{k,1,n}],{n,1,10}];
For example:
In[37]:=
Sn[[3]]
Out[37]=
Cos[x] Cos[2 x] Cos[3 x]
------ + -------- + --------
Pi Pi Pi
Let's see how we did. Be prepared to wait.
In[38]:=
Plot[a0+Sn[[10]],{x,-Pi,Pi},PlotRange->{-1,5}];

Do you think you can see how this could converge to the delta function at x=0? I would say experiment with more and more partial sums, but Mathematica takes a loooooong time to plot larger ones.
Up to Fourier Series Examples