Mathematics 173 – Applied Mathematics 1 Lab/Problem Set 5 – Fourier Series November 2, 1999

Background

Last week, we introduced the Fourier series of a function f(x) on [−L, L]:

a_{0} + ∑_{n=1}^{∞} (a_{n} cos (\frac{nπx}{L}) + b_{n} sin (\frac{nπx}{L}))

where:

a_{0} = \frac{1}{2L} ∫_{−L}^{L} f(x) dx
a_{n} = \frac{1}{L} ∫_{−L}^{L} f(x) cos (\frac{nπx}{L}) dx if n ≥ 1
b_{n} = \frac{1}{L} ∫_{−L}^{L} f(x) sin (\frac{nπx}{L}) dx for n ≥ 1

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).

Lab Problems

I. A First Worked Example – the “sawtooth function”. Let f(x) = x on [−1, 1] (L = 1). This is clearly piecewise continuous! A) The Fourier coefficients can be computed in Maple as follows. First enter the command

                            assume(n,integer);

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:

                          A0 := int(x,x=-1..1)/2;
                   A := n -> int(x*cos(n*Pi*x),x=-1..1);
                   B := n -> int(x*sin(n*Pi*x),x=-1..1);

Enter these definitions.

A) Plot the partial sums

a_{0} + ∑_{n=1}^{N} (a_{n} cos(nπx) + b_{n} sin(nπx))

of the Fourier series together with f(x) for x ∈ [−1, 1] and N = 5, 10, 20. Describe what is happening in words.

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.

C) What is the Fourier series doing at x = …, −3, −1, 1, 3, … where the periodic extension of f has jump discontinuities?

II. Repeat question I for the function f(x) = e^{−x} on [−1, 1].

III. The “boxcar function”. Repeat question I for the function

f(x) = \{ \begin{matrix}1 & if −1/2 ≤ x ≤ 1/2 \\ 0 & if |x| > 1/2 \end{matrix}

You will need first to figure out how to compute the Fourier coefficients. (The function f can be defined using the 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?

Problem Set

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!)

V. Show that if f is an even piecewise continuous function on [−L, L], then all the Fourier sine coefficients are zero: b_{n} = 0 for all n ≥ 1. Similarly, show that if f is an odd piecewise continuous function on [−L, L], then all the Fourier coefficients a_{n} are zero (n ≥ 0). You saw an example of that in Lab Problem I.

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} + ∑_{n=1}^{∞} (a_{n} cos (\frac{2nπx}{b − a}) + b_{n} sin (\frac{2nπx}{b − a}))

where

a_{0} = \frac{1}{b−a} ∫_{a}^{b} f(x) dx
a_{n} = \frac{2}{b−a} ∫_{a}^{b} f(x) cos (\frac{2nπx}{b−a}) dx if n ≥ 1
b_{n} = \frac{2}{b−a} ∫_{a}^{b} f(x) sin (\frac{2nπx}{b−a}) dx all n ≥ 1

from the formulas on [−L, L], by an appropriate change of variables.

VII. A famous formula.

A) Determine the Fourier series of f(x) = x^{2} on [−π, π]. B) Show that the series converges for all x ∈ R by using the comparison test and com-

paring with the convergent series ∑_{n=1}^{∞} \frac{4}{n^{2}} . C) Using the Pointwise Convergence Theorem from class on Thursday, November 4, show

that the Fourier series converges to π^{2} at x = π. D) From part C, deduce the famous formula:

∑_{n=1}^{∞} \frac{1}{n^{2}} = \frac{π^{2}}{6}

E) Similarly, deduce that

∑_{n=1}^{∞} \frac{(−1)^{n}}{n^{2}} = \frac{π^{2}}{12}

Assignment

Individual write-ups due Tuesday, November 9.