The Delta Function

The delta function at x=0 is not periodic, so we consider instead the periodic extension on the interval -2Pi to 2Pi, 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) (Filtering Property).

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)

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