Worksheet: fcs.mw
Fourier Cosine Series
This worksheet examines the convergence of the Fourier cosine series for :
y=|x| - π < x< π
A Fourier Cosine Series
| > | restart: |
| > | f:=abs(x); |
| (1.1) |
| > | plot(f, x=-Pi..Pi); |
![]() |
| > | an:=int(f*cos(n*x),x=-Pi..Pi)/Pi; |
| (1.2) |
| > | assume(n,integer);#Letting MAPLE know n is an integer simplifies the calculation
an:=int(f*cos(n*x),x=-Pi..Pi)/(Pi); |
| (1.3) |
| > | A:=n->int(f*cos(n*x),x=-Pi..Pi)/(Pi); |
![]() |
(1.4) |
| > | seq(A(n),n=1..10); |
| (1.5) |
| > | g:= M->A(0)/2 +sum(A(n)*cos(n*x),n=1..M); |
| (1.6) |
| > | h:=g(3); |
| (1.7) |
| > | plot({f,h},x=-Pi..Pi); |
![]() |
| > | s:=seq(g(2*M+1),M=0..4); |
| (1.8) |
| > | plot({s,f},x=-3*Pi..3*Pi); |
![]() |
| > | plot({s,f},x=0..0.5,y=0..0.5); |
![]() |
Bessel's Inequality and Parseval's Theorem
Let's compute the (norm)^2 of F(x) and the n-term approximation of F
| > | norm2:=h->int(h^2,x=-Pi..Pi); |
| (2.1) |
Compute the L^2 norm of f
| > | f2:=norm2(f); |
| (2.2) |
And now compare it to the n-term approximation for n=1 to 20. Note the difference is always positive (as a result of Bessel's inequality) and converges to zero (as a result of Parseval's Theorem).
| > | E2:=seq(evalf(f2-norm2(g(N))),N=1..20); |
| (2.3) |
Parseval's Identity tells us that
‖f‖2=π[a02 + ∑(a02 /2+ b02 )
which yields for this problem that
| > | Sum (1/(2*n-1)^4,n=1..infinity)=sum (1/(2*n-1)^4,n=1..infinity); |
| (2.4) |
| > |