FOURIER SERIES_Math 21b_Spring 08_Harvard
FOURIER SERIES_Math 21b_Spring 08_Harvard
Smooth functions f (x) on [−π, π] form a linear space X. There is an inner product in X defined by
1
Rπ
hf, gi = π −π
f (x)g(x) dx
Proof. To check linear independence a few integrals need to be computed. For all n, m ≥ 1, with n 6= m you
have to show:
h √12 , √12 i = 1
hcos(nx), cos(nx)i = 1, hcos(nx), cos(mx)i = 0
hsin(nx), sin(nx)i = 1, hsin(nx), sin(mx)i = 0
hsin(nx), cos(mx)i
√ =0
hsin(nx), 1/ √2i = 0
hcos(nx), 1/ 2i = 0
To verify the above integrals in the homework, the following trigonometric identities are useful:
We take it for granted that the series converges and that the identity holds for all x where f is continuous.
ODD AND EVEN FUNCTIONS. Here is some advise which can save time when computing Fourier series:
EXAMPLE 1. Let f (x) = x on [−π, π]. This is an odd function (f (−x)+f (x) = 0) so that it has a sin series: with
Rπ n+1
bn = π1 −π x sin(nx) dx = −1 /n, we get x = n=1 2 (−1)n
2 π n+1
P∞
π (x cos(nx)/n + sin(nx)/n |−π ) = 2(−1) sin(nx).
For example
π
2 = 2( 11 − 1
3 + 1
5 − 71 ...)
is a formula of Leibnitz.
EXAMPLE 2. Let f (x) = cos(x) + 1/7 cos(5x). This trigonometric polynomial is already the Fourier series.
There is no need to compute the integrals. The nonzero coefficients are a1 = 1, a5 = 1/7.
EXAMPLE 3. Let f (x) = 1 on [−π/2, π/2] and f (x) = 0 else. This is an even function f (−x) − f (x) = 0 so
√ R π/2 π/2
that it has a cos series: with a0 = 1/( 2), an = π1 −π/2 1 cos(nx) dx = sin(nx) 2(−1)m
πn |−π/2 = π(2m+1) if n = 2m + 1 is
odd and 0 else. So, the series is
1.2
a0 Pn Pn
The function fn (x) = √
2
+ k=1 ak cos(kx) + k=1 bk sin(kx) is 0.4
-0.2
THE PARSEVAL EQUALITY. When evaluating the square of the length of f with the square of the length of
the series, we get
P∞
||f ||2 = a20 + k=1 a2k + b2k .
EXAMPLE. We have seen in example 1 that f (x) = x = 2(sin(x) − sin(2x)/2 + sin(3x)/3 Rπ − sin(4x)/4 + ...
Because the Fourier coefficients are bk = 2(−1)k+1 /k, we have 4(1 + 1/4 + 1/9 + ...) = π1 −π x2 dx = 2π 2 /3 and
so
1 1 1 1 1 π2
1 + 4 + 9 + 16 + 25 + ... = 6
Isn’t it fantastic that we can sum up the reciprocal squares? This formula has been obtained already by
Leonard Euler.
HOMEWORK: (this homework is due either Wednesday or Thursday. Remember that there is a Mathematica
lab due on Thursday or Friday, the last day of class.)
√
1. Verify that the functions cos(nx), sin(nx), 1/ 2 form an orthonormal family.
2. Find the Fourier series of the function f (x) = |x|.
3. Find the Fourier series of the function cos2 (x) + 5 sin(7x) + 55. You may find the double angle formula
cos2 (x) = cos(2x)+1
2 useful.
4. Find the Fourier series of the function f (x) = | sin(x)|.
5. In the previous problem 4) you should have gotten a series
2 4 cos(2x) cos(4x) cos(6x)
f (x) = − + 2 + 2 + ...
π π 22 − 1 4 −1 6 −1
FUNCTIONS OF TWO VARIABLES. We consider functions f (x, t) which are for fixed t a piecewise smooth
function in x. Analogously as we studied the motion of a vector ~v (t), we are now interested in the motion of a
function f in time t. While the governing equation for a vector was an ordinary differential equation ẋ = Ax
(ODE), the describing equation is now be a partial differential equation (PDE) f˙ = T (f ). The function
f (x, t) could denote the temperature of a stick at a position x at time t or the displacement of a string
at the position x√at time t. The motion of these dynamical systems will be easy to describe in the orthonormal
Fourier basis 1/ 2, sin(nx), cos(nx) treated in an earlier lecture.
PARTIAL DERIVATIVES. We write fx (x, t) and ft (x, t) for the partial derivatives with respect to x or t.
The notation fxx (x, t) means that we differentiate twice with respect to x.
THE HEAT EQUATION. The temperature distribution f (x, t) in a metal bar [0, π] satisfies the heat equation
This partial differential equation tells that the rate of change of the temperature at x is proportional to the
second space derivative of f (x, t) at x. The function f (x, t) is assumed to be zero at both ends of the bar and
f (x) = f (x, t) is a given initial temperature distribution. The constant µ depends on the heat conductivity
properties of the material. Metals for example conduct heat well and would lead to a large µ.
We will solve the problem in the same way as we solved linear differential equations:
d
dt ~
x = A~x
We use that the Fourier basis is just the diagonalization: D2 cos(nx) = −n2 cos(nx) and D2 sin(nx) =
−n2 sin(nx) show that cos(nx) and sin(nx) are eigenfunctions to D2 with eigenvalue n2 . By a symmetry
trick, we can focus on sin-series from now on.
SOLVING THE HEAT EQUATION WITH FOURIER THEORY. The heat equation ft (x, t) = µfxx (x, t) with
smooth f (x, 0) = f (x), f (0, t) = f (π, t) = 0 has the solution
2
Rπ
−n2 µt
P∞
f (x, t) = n=1 bn sin(nx)e
bn = π 0
f (x) sin(nx) dx
2
Proof: With the initial condition f (x) = sin(nx), we have the evolution f (x, t) = e−µn t sin(nx). If f (x) =
−µn2 t
P∞ P∞
n=1 bn sin(nx) then f (x, t) = n=1 bn e sin(nx).
A SYMMETRY TRICK. Given a function f on the interval [0, π] which is zero at 0 and π. It can be extended
to an odd function on the doubled integral [−π, π].
The odd
The function
symmetric
is given on
extension on
[0, π].
[−π, π].
The exponential term containing the time makes the function f (x, t) converge to 0: The body cools. The higher
frequencies are damped faster: ”smaller disturbances are smoothed out faster.”
VISUALIZATION. We can plot the graph of the function f (x, t) or slice this graph and plot the temperature
distribution for different values of the time t.
THE WAVE EQUATION. The height of a string f (x, t) at time t and position x on [0, π] satisfies the wave
equation
d2
dt2 f = c2 D 2 f
d2
dt2 ~
x = A~x
d2
If A is diagonal, then every basis vector x satisfies an equation of the form dt2 x = −c2 x which has the solution
x(t) = x(0) cos(ct) + x′ (0) sin(ct)/c.
SOLVING THE WAVE EQUATION WITH FOURIER THEORY. The wave equation ftt = c2 fxx with f (x, 0) =
f (x), ft (x, 0) = g(x), f (0, t) = f (π, t) = 0 has the solution
f (x, t) = 2
Rπ
P∞ an = π f (x) sin(nx) dx
a
n=1 n sin(nx) cos(nct) + 2
R0π
bn
sin(nx) sin(nct) bn = π 0 g(x) sin(nx) dx
nc
Proof: With f (x) = sin(nx), g(x) = 0, the solution is fP (x, t) = cos(nct) sin(nx). With
P∞f (x) = 0, g(x) = sin(nx),
the solution is f (x, t) = 1c sin(ct) sin(nx). For f (x) = n=1 an sin(nx) and g(x) = n=1 bn sin(nx), we get the
∞
VISUALIZATION. We can just plot the graph of the function f (x, t) or plot the string for different times t.
NOTATION:
HOMEWORK. This homework is due until Tuesday morning May 6, 2008 in the mailboxes of your CA:
6) Solve the heat equation ft = µfxx on [0, π] with the initial condition f (x, 0) = | sin(3x)|.
We want to see in exercises 2-4 how to deal with solutions to the heat equation, where the boundary values are
not 0. Problems 2-4 belong together:
7) Verify that for any constants a, b the function h(x, t) = (b − a)x/π + a is a solution to the heat equation.
8) Assume we have the problem to describe solutions f (x, t) to the heat equations, where f (0, t) = a and
f (π, t) = b. Show that g(x, t) = f (x, t)−h(x, t) is a solution of the heat equation with g(0, t) = 0 and g(π, t) = 0.
9) Solve the heat equation with the initial condition f (x, 0) = f (x) = sin(5x) + 3 sin(x) + x/π and satisfying
f (0, t) = 0, f (π, t) = 1 for all times t. This is a situation, when the stick is kept at constant but different
temperatures on the both ends.
10) A piano string is fixed at the ends x = 0 and x = π and is initially undisturbed. The piano hammer induces
an initial velocity ft (x, 0) = g(x) onto the string, where g(x) = sin(2x) on the interval [0, π/2] and g(x) = 0 on
[π/2, π]. Find the motion of the string.