The Delta Function
Clear[a0,a,b,Sn]
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}]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.
Sn=Table[Sum[a[k]u[x,Pi,k],{k,1,n}],{n,1,10}];For example:
Sn[[3]]
Let's see how we did. Be prepared to wait.
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