\magnification = \magstep1
\centerline{Mathematics 173 -- Applied Mathematics 1}
\centerline{Lab/Problem Set 5 -- Fourier Series}
\centerline{November 2, 1999}
\bigskip
\noindent
{\it Background}
\bigskip
Last week, we introduced the Fourier series of a function $f(x)$ on 
$[-L, L]$:
$$a_0 + \sum_{n=1}^\infty \left( a_n \cos\left({n\pi x\over L}\right) +
b_n \sin\left({n\pi x\over L}\right) \right)$$
where:
$$\cases{
a_0 = {1\over 2L} \int_{-L}^L f(x)\ dx & \cr
a_n = {1\over L} \int_{-L}^L f(x) \cos\left({n\pi x\over L}\right)\ dx & if $n \ge 1$\cr
b_n = {1\over L} \int_{-L}^L f(x) \sin\left({n\pi x\over L}\right)\ dx & for $n \ge 1$\cr}$$
{\it Important Note:} Check your class notes from last Thursday -- I have a 
feeling I may have put an extra factor of $2$ in the formulas for the coefficients
$a_n$, $b_n$ that should not be there.  The correct formulas are the ones 
above(!)

In the lab portion of this assignment you will compute 
Fourier series for several functions 
using Maple, plot (partial sums of) the Fourier series together with the function, 
and observe some patterns.  (There are also a few problems at the end for
after the lab).

\bigskip
\noindent
{\it Lab Problems}
\bigskip
\noindent
I.  A First Worked Example -- {\it the ``sawtooth function''}.  
Let $f(x) = x$ on $[-1,1]$ ($L = 1$).  This is clearly piecewise
continuous!
\item{A)}  The Fourier coefficients can be computed in Maple as follows.
First enter the command 
\medskip
\centerline{\tt assume(n,integer);}
\medskip
Then as in the last lab, we can define functions $A$ and $B$ that return 
the values of the Fourier coefficients.  This time, though, we want to
see the coefficients as formulas in $n$, not just as numerical values.
Use:
\medskip
\centerline{\tt A0 := int(x,x=-1..1)/2;}
\centerline{\tt A := n -> int(x*cos(n*Pi*x),x=-1..1);}
\centerline{\tt B := n -> int(x*sin(n*Pi*x),x=-1..1);}
\medskip
\noindent
Enter these definitions.
\bigskip
\item{A)}  Plot the partial sums 
$$a_0 + \sum_{n=1}^N \left( a_n \cos(n\pi x) +
b_n \sin(n\pi x) \right)$$
of the Fourier series together with $f(x)$ for $x \in [-1,1]$ and $N = 5, 10, 20$.
Describe what is happening in words.
\item{B)}  Now plot the function $f(x)$ together with the partial sum with
$N = 20$ on the interval $[-4,4]$.  Explain why $f$ and the Fourier series
are different on part of this larger interval.
\item{C)}  What is the Fourier series doing at $x = \ldots, -3, -1, 1, 3, \ldots$
where the periodic extension of $f$ has jump discontinuities?  
\bigskip
\noindent
II.  Repeat question I for the function $f(x) = e^{-x}$ on $[-1,1]$.
\bigskip
\noindent
III. {\it The ``boxcar function''}. Repeat question I for the function 
$$f(x) = \cases{1 & if $-1/2 \le x \le 1/2$\cr
                0 & if $|x| > 1/2$\cr}$$
You will need first to figure out how to compute the Fourier coefficients.
(The function $f$ can be defined using the {\tt piecewise}
command in Maple.  Look this up in the online help for more info.)  
Also, in part C, what is happening at the points $-1/2, 1/2$, etc. where
the function $f$ itself has jump discontinuities?
\bigskip
\noindent
{\it Problem Set}
\bigskip
\noindent
IV.  Verify Maple's formulas for the Fourier coefficients
in lab problems I, II, III by computing the integrals by hand.   (Hint:
Review integration by parts if necessary!)
\bigskip
\noindent
V. Show that if $f$ is an {\it even} piecewise continuous function 
on $[-L,L]$, then all the Fourier sine coefficients are zero:  $b_n = 0$
for all $n \ge 1$.  Similarly, show that if $f$ is an {\it odd} piecewise
continuous function on $[-L,L]$, then all the Fourier coefficients
$a_n$ are zero ($n \ge 0$).  You saw an example of that in Lab Problem I.
\bigskip
\noindent
VI. We can also develop Fourier expansions for functions $f$ on
intervals $[a,b]$ different from the intervals $[-L,L]$ symmetric about 0.
Show how to derive the corresponding formulas
$$f(x) = a_0 + \sum_{n=1}^\infty \left( a_n \cos\left({2n\pi x\over b-a}\right) +
b_n \sin \left({2n\pi x\over b-a}\right)\right)$$
where 
$$\cases{a_0 = {1\over b - a}\int_a^b f(x) \ dx &\cr
a_n = {2\over b - a}\int_a^b f(x) \cos\left({2n\pi x\over b-a}\right)\ dx & if $n \ge 1$\cr
b_n = {2\over b - a}\int_a^b f(x) \sin\left({2n\pi x\over b-a}\right)\ dx & all $n \ge 1$\cr}$$
from the formulas on $[-L,L]$, by an appropriate change of variables.
\bigskip
\noindent
VII.  {\it A famous formula}.
\item{A)} Determine the Fourier series of $f(x) = x^2$ on $[-\pi,\pi]$.
\item{B)} Show that the series converges for all $x \in {\bf R}$ by using
the comparison test and comparing with the convergent series
$\sum_{n=1}^\infty {4 \over n^2}$.
\item{C)}  Using the Pointwise Convergence Theorem from class on Thursday,
November 4, show that the Fourier series converges to $\pi^2$ at $x = \pi$.
\item{D)}  From part C, deduce the famous formula:
$$\sum_{n=1}^\infty {1\over n^2} = {\pi^2\over 6}$$
\item{E)}  Similarly, deduce that
$$\sum_{n=1}^\infty {(-1)^n\over n^2} = {\pi^2\over 12}$$
\bigskip
\noindent
{\it Assignment}
\bigskip
Individual write-ups due Tuesday, November 9.
\bye

              