The Delta Function

The delta function at x=0 is not periodic, so we consider instead the periodic extension, that is, a sum of delta functions: at x=0, x=2Pi, x=-2Pi, x=4Pi, x=-4Pi, etc.

We know that the integral from -infinity to infinity of the delta function at x=a is 1. We also know that the integral from -infinity to infinity of the delta function at x=a times f(x) is f(a).

With this in mind, the Fourier coefficients of the delta function are:
(you should verify these by hand!):
a0=1/2Pi
ak=1/Pi (since Cos[0]=1)
bk=0 (since Sin[0]=0)


  Clear[a0,a,b]
  a0=1/(2Pi);
  a=Table[1/Pi,{k,1,20}];
  

This gives the partial sums of the akCos[kx] from 1 to 20 (we'll have to add a0 later).


  Sn=Table[Sum[a[[k]]Cos[k x],{k,1,n}],{n,1,20}];

For example:


  Sn[[3]]

Let's see how we did.


  Plot[a0+Sn[[10]],{x,-Pi,Pi},PlotRange->{-1,5}];

Do you think you can see how this could converge to the delta function? 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