Fourier Series
Fourier Series
n=1
b
n
cos(nx) +
n=1
c
n
sin(nx).
Virtually any periodic function that arises in applications can be represented as the
sum of a Fourier series. For example, consider the three functions whose graph are
shown below:
These are known, respectively, as the triangle wave (x), the sawtooth wave N(x),
and the square wave (x). Each of these functions can be expressed as the sum of
a Fourier series:
(x) = cos x +
cos 3x
3
2
+
cos 5x
5
2
+
cos 7x
7
2
+
cos 9x
9
2
+
N(x) = sin x +
sin 2x
2
+
sin 3x
3
+
sin 4x
4
+
sin 5x
5
+
(x) = sin x +
sin 3x
3
+
sin 5x
5
+
sin 7x
7
+
sin 9x
9
+
Fourier series are critically important to the study of dierential equations, and they
have many applications throughout the sciences. In addition, Fourier series played
an important role in the development of analysis, and the desire to prove theorems
about their convergence was a large part of the motivation for the development of
Lebesgue integration.
These notes develop Fourier series on the level of calculus. We will not be worrying
about convergence, and we will not be not be proving that any given function is
Fourier Series 2
n cos nx sin nx
2 cos
2
x sin
2
x 2 cos xsin x
3 cos
3
x 3 cos xsin
2
x 3 cos
2
xsin x sin
3
x
4 cos
4
x 6 cos
2
xsin
2
x + sin
4
x 4 cos
3
xsin x 4 cos xsin
3
x
5 cos
5
x 10 cos
3
xsin
2
x + 5 cos xsin
4
x 5 cos
4
xsin x 10 cos
2
xsin
3
x + sin
5
x
Table 1: Multiple-angle formulas.
actually equal to the sum of its Fourier series. We will revisit the theoretical aspects
of this topic later in the course after we have dened the Lebesgue integral and proven
Lebesgues Dominated Convergence Theorem.
Trigonometric Polynomials
A trigonometric polynomial is a polynomial expression involving cos x and sin x:
cos
5
x + 6 cos
3
x sin
2
x + 3 sin
4
x + 2 cos
2
x + 5
Because of the identity cos
2
x + sin
2
x = 1, most trigonometric polynomials can be
written in several dierent ways. For example, the above polynomial can be rewrit-
ten as
5 cos
3
x sin
2
x + 3 sin
4
x + cos
3
x 2 sin
2
x + 7
Fourier Sums
A Fourier sum is a Fourier series with nitely many terms:
5 + 3 sin 2x + 4 cos 5x 3 sin 5x + 2 cos 8x.
Every Fourier sum is actually a trigonometric polynomial, and any trigonometric
polynomial can be expressed as a Fourier sum.
Converting a Fourier sum to a trigonometric polynomial is fairly straightfor-
ward: simply substitute the appropriate multiple-angle identity for each cos nx and
sin nx (see table 1).
It is less obvious that every trigonometric polynomial can be expressed as a Fourier
Fourier Series 3
sum. This depends on the three product-to-sum formulas:
cos Acos B =
1
2
cos(A B) +
1
2
cos(A + B)
sin Acos B =
1
2
sin(A B) +
1
2
sin(A + B)
sin Asin B =
1
2
cos(A B)
1
2
cos(A + B).
These identities allow us to transform any product of trigonometric functions into a
sum. By applying them repeatedly, we can remove all of the multiplications from a
trigonometric polynomial, resulting in a Fourier sum.
Alternatively, one can use these identities to derive power-reduction formulas
for cos
j
x sin
k
x, the rst few of which are listed below:
j = 0 j = 1 j = 2 j = 3
k = 0 1 cos x
1 + cos 2x
2
3 cos x + cos 3x
4
k = 1 sin x
sin 2x
2
sin x + sin 3x
4
2 sin 2x + sin 4x
8
k = 2
1 cos 2x
2
cos x cos 3x
4
1 cos 4x
8
2 cos x cos 3x cos 5x
16
k = 3
3 sin x sin 3x
4
2 sin 2x sin 4x
8
2 sin x + sin 3x sin 5x
16
3 sin 2x sin 6x
32
These formulas tell us how to convert each term of a trigonometric polynomial directly
into a Fourier sum.
Fourier Series 4
Orthogonality
There is a nice integral formula for nding the coecients of any Fourier sum. This
is based on the orthogonality of the functions cos nx and sin nx:
Theorem 1 Orthogonality Relations
If j, k N, then:
sin jx sin kx dx =
if j = k
0 otherwise,
and
sin nx dx = 0 and
cos nx dx =
2 if n = 0
0 otherwise.
If j, k N, we can use the product-to-sum identities to deduce that
cos jx cos kx dx =
if j = k
0 otherwise,
and
if j = k
0 otherwise,
and
b
a
f(x) g(x) dx.
Fourier Series 5
A collection T of nonzero functions on [a, b] is said to be orthogonal if f, g = 0
for all f, g T with f ,= g. According to the above theorem, the functions
cos nx
nN
sin nx
nN
are orthogonal on the interval [, ]. Note that these functions are also orthogonal
to the constant function 1.
This denition of orthogonality is related to the notion of orthogonality in linear
algebra. Specically, let C([a, b]) be the vector space of all real-valued continuous
functions on the interval [a, b]. Then the formula for f, g given above denes an
inner product on this vector space (analogous to the dot product on R
n
), under which
orthogonal functions are the same as orthogonal vectors.
Theorem 2 Fourier Coecients
Let
f(x) = a +
N
n=1
b
n
cos nx +
N
n=1
c
n
sin nx.
Then
a =
1
2
f(x) dx.
Furthermore, for all n 1, . . . , N,
b
n
=
1
cos kxdx +
N
n=1
b
n
n=1
c
n
k
=
v u
k
u
k
u
k
for each k, where denotes the inner product of vectors.
Corollary 3 Uniqueness of Fourier Sums
Let
f(x) = a +
N
n=1
b
n
cos nx +
N
n=1
c
n
sin nx
and
g(x) = A +
N
n=1
B
n
cos nx +
N
n=1
C
n
sin nx.
Then f = g if and only if a = A and b
n
= B
n
and c
n
= C
n
for all n.
Finally, we should mention the following famous formula for the inner product of two
trigonometric polynomials. This follows directly from the orthogonality relations:
Fourier Series 7
Theorem 4 Inner Product Formula
Let
f(x) = a +
N
n=1
b
n
cos nx +
N
n=1
c
n
sin nx
and
g(x) = A +
N
n=1
B
n
cos nx +
N
n=1
C
n
sin nx.
Then
f(x) g(x) dx = aA +
N
n=1
b
n
B
n
+
N
n=1
c
n
C
n
.
Fourier Series
We have seen how the coecients of the Fourier sum for a trigonometric polynomial
f(x) can be found using denite integrals. The same formulas can be used to dene
Fourier coecients for any function f:
Denition: Fourier Coecients for f
The Fourier coecients for a function f : [, ] are the real number a and the
sequences b
n
and c
n
dened by the following formulas:
a =
1
2
f(x) dx, b
n
=
1
n=1
b
n
cos nx +
n=1
c
n
sin nx.
where a, b
n
, and c
n
are the Fourier coecients for f.
If f is a trigonometric polynomial, then its corresponding Fourier series is nite, and
the sum of the series is equal to f(x). The surprise is that the Fourier series usually
converges to f(x) even if f isnt a trigonometric polynomial.
Fourier Series 8
Figure 1: Six partial sums of the Fourier series for x
2
.
EXAMPLE 1 Let f : [, ] R be the function f(x) = x
2
. The integrals
a =
1
2
x
2
dx, b
n
=
1
x
2
cos nx dx, c
n
=
1
x
2
sin nx dx
yield the following Fourier coecients:
a =
2
3
, b
n
= (1)
n
4
n
2
, and c
n
= 0.
Thus the Fourier series for f is
2
3
+
n=1
(1)
n
4
n
2
cos nx =
2
3
4 cos x +
4 cos 2x
2
2
+
4 cos 3x
3
2
+ .
This series converges uniformly to f(x) on the interval [, ]. Figure 1 shows the
rst six partial sums of this series, together with the parabola y = x
2
.
Of course, the series only converges to x
2
on the interval [, ]. Over the real
line, the sum of the series is periodic with period 2, as shown in gure 2.
2 3 4 5 0 2 3 4 5
2
Figure 2: The sum of the Fourier series for x
2
.
Fourier Series 9
Figure 3: Eight partial sums of the Fourier series for x.
EXAMPLE 2 Now consider the function f : [, ] R dened by f(x) = x. The
Fourier coecients for this function are
a = 0, b
n
= 0, and c
n
= (1)
n+1
2
n
,
so the Fourier series for f is
n=1
(1)
n+1
2
n
sin nx = 2 sin x
2
2
sin 2x +
2
3
sin 3x
2
4
sin 4x + .
Note that the coecients of this series are essentially the harmonic series, which
diverges. Thus, it is very unclear that this series will even converge for a typical value
of x.
The rst eight partial sums of this series are shown in gure 3. As you can see,
this series appears to converge to f(x) for most values of x. Indeed, it does converge
to f(x) for all values of x in the interval (, ), though this is relatively dicult to
prove.
Also, as you can see from the graphs, all of the partial sums of the Fourier series
have roots at and . It follows that the sum of the series also has roots at these
points. Therefore, the Fourier series for f(x) converges pointwise to the function
g(x) =
x if < x <
0 if x = .
on the interval [, ].
Figure 4 shows the sum of this Fourier series over the real line. This function is
similar to the sawtooth wave discussed in the introduction, although the graph in
gure 4 is more explicit about the behavior at the discontinuities.
Fourier Series 10
2 3 4 5 2 3 4 5
2
f = 0,
2
f =
f
t
, and
2
f =
2
f
t
2
These equations
1
are respectively known as Laplaces equation, the heat equa-
tion, and the wave equation. These are arguably the three most important partial
dierential equations, and much of the study of PDEs is devoted to understanding
just these three. As we shall see, Fourier series can be quite helpful for solving them.
1
The expression
2
f in these equations is called the Laplacian, and is dened by the formula
2
f =
2
f
x
2
1
+ +
2
f
x
2
n
.
Intuitively, the Laplacian measures how much the value of f at point diers from the average value
of f at nearby points.
Fourier Series 11
Laplaces Equation
Let D
2
be the unit disc centered at the origin in R
2
, and consider Laplaces equation
for a function f : D
2
R. This has the form:
2
f
x
2
+
2
f
y
2
= 0.
In general, solutions to Laplaces equation are called harmonic functions.
In the same way that an ordinary dierential equation requires initial conditions
to specify a unique solution, a partial dierential equation requires boundary con-
ditions. In the present case, what we need to know is the value of the function on
the boundary circle:
Dirichlets Problem
Given a function g : S
1
R, nd a harmonic function f : D
2
R that agrees
with g on S
1
.
In principle, Dirichlets problem should have a solution for virtually any function g.
The reason for this is based on physics, specically the distribution of heat inside solid
bodies. According to the theory of heat transfer, the temperature T(x, y) inside any
solid body in a steady state must be a harmonic function. Imagine, then, that we heat
and cool the edge of a metal disc so as to maintain a specic temperature function on
the boundary circle. If we wait a long time, the temperature function T(x, y) inside
the disc should reach a steady state, and this will be the desired solution to Dirichlets
problem.
So how can we solve Dirichlets problem mathematically? Well, consider the
functions
n
: D
2
R and
n
: D
2
R dened by
n
(x, y) = r
n
cos n and
n
(x, y) = r
n
sin n,
where (r, ) are the polar coordinates for a point (x, y). It is not dicult to show that
n
and
n
are harmonic functions for any n N. Moreover, any expression such as
3 + 2r
2
cos 2 5r
3
sin 3 + r
8
sin 8
is also a harmonic function.
2
This gives us a large number of dierent solutions to
work with.
In particular, observe that
n
(x, y) and
n
(x, y) restrict to the functions cos n
and sin n on the unit circle. Therefore, we now know how to solve Dirichlets problem
whenever g() is a trigonometric polynomial.
2
In general, any linear combination of solutions to Laplaces equation is again a solution. A
dierential equation with this property is called linear.
Fourier Series 12
EXAMPLE 3 Let g : S
1
R be the function
g() = 5 cos + 4 sin 2 6 cos 5.
Find a harmonic function f : D
2
R that agrees with g on S
1
.
SOLUTION The desired harmonic function is
f(x, y) = 5r cos + 4r
2
sin 2 6r
5
cos 5.
How does this help in general? Well, given any function g : S
1
R, we can try
to express g as a Fourier series involving cos n and sin n:
g() = a +
n=1
b
n
cos n +
n=1
c
n
sin n.
Assuming this series actually converges to g, we can treat the Fourier series as though
it were a trigonometric polynomial, giving us the following harmonic function:
f(x, y) = a +
n=1
b
n
r
n
cos n +
n=1
c
n
r
n
sin n.
Assuming all of this works, we should be able to solve Dirichlets problem for any
function g that can be expressed as the sum of a Fourier series.
EXAMPLE 4 Let g : S
1
R be the function
g(x, y) =
1 if x > 0
1/2 if x = 0
0 if x < 0
.
Find a harmonic function f : D
2
R that agrees with g on S
1
.
SOLUTION In terms of , we have
g() =
1 if /2 < < /2
1/2 if = /2
0 otherwise.
This function is indeed the sum of a Fourier series. The integrals for the Fourier
coecients are
a =
1
2
/2
/2
dx, b
n
=
1
/2
/2
cos nx dx, and c
n
=
1
/2
/2
sin nx dx.
Fourier Series 13
1.0 0.5 0.0 0.5 1.0
1.0
0.5
0.0
0.5
1.0
Figure 5: A harmonic function on the unit disc.
This gives a = 1/2 and c
n
= 0, while b
n
is the sequence
2
, 0,
2
3
, 0,
2
5
, 0, ,
2
7
, . . .
Thus
g() =
1
2
+
2
cos
cos 3
3
+
cos 5
5
cos 7
7
+
.
Then
f(x, y) =
1
2
+
2
r cos
r
3
cos 3
3
+
r
5
cos 5
5
r
7
cos 7
7
+
n
(x, t) = e
n
2
t
cos nx and
n
(x, t) = e
n
2
t
sin nx.
Again, any combination of these will also be a solution to the heat equation:
2 + 5e
t
cos t + 8e
9t
sin 3t 6e
25t
cos 5t
This lets us solve the heat equation whenever g(x) is a trigonometric polynomial.
For an arbitrary function g(x), we can follow the same procedure we did before.
First we attempt to express g as a Fourier series:
g(x) = a +
n=1
b
n
cos nx +
n=1
c
n
sin nx.
Assuming this succeeds, we obtain a candidate solution to the heat equation for
which T(x, 0) = g(x):
T(x, t) = a +
n=1
b
n
e
n
2
t
cos nx +
n=1
c
n
e
n
2
t
sin nx.
Of course, this is all based on conjecture and hope. We have little evidence that the
above series will converge in general. Also, this series will only be a solution to the
heat equation if it is valid to take its derivative by separately dierentiating each
term. We will need to develop a lot of theory if we want to make this rigorous.
The Wave Equation
Consider a stringed instrument, such as a guitar, piano, or harp. Such an instrument
consists of several long strings held at high tension, which vibrate and produce sound
when they are disturbed. The classical vibrating string problem is to model the
motion of such a string.
Fourier Series 15
Imagine that the string is stretched out along the x-axis, and is only allowed to
vibrate in the vertical direction. At each time t, the vertical displacement of the
string will be a function u(x), with the shape of the string being the graph of this
function. Thus we can describe the motion of the string by a function u(x, t), where
x is horizontal position and t is time.
Under ideal conditions, the motion of the string will be governed by the following
equation:
2
u
x
2
=
2
u
t
2
.
This is the one-dimensional version of the wave equation.
In principle, we should be able to solve this equation if we are given the initial
shape u(x, 0) and initial velocity (u/t)(x, 0) of the string. For simplicity, we assume
that the string has length , with x restricted to the interval [0, ]. In addition, we
assume that the string is pinned at its ends, so that u(0, t) = u(, t) = 0 for all t R:
Vibrating String Problem
Given two functions g, h: [0, ] R, nd a solution u: [0, ] R R to the wave
equation satisfying the following conditions:
u(0, t) = u(, t) = 0, u(x, 0) = g(x),
u
t
(x, 0) = h(x).
The solution here is slightly more complicated than the previous cases. Consider
the following solutions to the wave equation:
n
(x, t) = sin nx cos nt and
n
(x, t) = sin nx sin nt.
Note that
n
(x, t) and
n
(x, t) describe the same sort of vibration, but are temporally
out of phase. Each solution
n
(x, t) has initial position g(x) = sin nx, but has zero
initial velocity. On the other hand, each solution
n
(x, t) restricts to g(x) = 0, but
has initial velocity h(x) = nsin nx.
These solutions let us solve the wave equation as long as g(x) and h(x) are trigono-
metric polynomials.
3
Specically, suppose that
g(x) =
N
n=1
A
n
sin nx and h(x) =
N
n=1
B
n
sin nx.
Then the corresponding solution to the wave equation is
u(x, t) =
N
n=1
A
n
sin nx cos nt +
N
n=1
B
n
n
sin nx sin nt.
3
Since the string is xed at both ends, we know that g(0) = g() = 0. Therefore, if g is a
trigonometric polynomial, it must be a sum of sines. The same goes for h.
Fourier Series 16
Figure 6: The normal modes
1
, . . . ,
7
.
Note that the factor of 1/n cancels with the n that we get from the derivative of
sin nt.
More generally, given any functions g and h, we can attempt to express both as
Fourier sine series:
g(x) =
n=1
A
n
sin nx and h(x) =
n=1
B
n
sin nx.
Then the corresponding solution to the wave equation ought to be
u(x, t) =
n=1
A
n
sin nx cos nt +
n=1
B
n
n
sin nx sin nt.
Incidentally, the basic solutions
n
(x, t) and
n
(x, t) to the wave equation are
known as normal modes. Physically, these correspond to certain standing waves in
the string (see gure 6). If the string used to produce music, the primary modes
1
and
1
sound the main note, while the remaining modes
2
,
3
, . . . and
2
,
3
, . . .
produce certain higher notes known as harmonics or overtones. The strength of
these overtones is responsible for the rich sound of stringed instruments.
Exercises
1. Let : R R, N: R R, and : R R be the three functions dened by
Fourier series in the introduction.
(a) Determine the range of each of these functions.
(b) Draw careful graphs of N(x) and (x), making sure to show the value of
each function at its points of discontinuity.
Fourier Series 17
2. Use the product-to-sum formulas and the table of power-reduction formulas to
express cos
6
x sin
6
x as a Fourier sum.
3. Let p
1
, p
2
, p
3
: [1, 1] R be the functions
p
1
(x) = 1, p
2
(x) = x, and p
3
(x) = 3x
2
1
(a) Compute p
i
, p
j
for all i, j 1, 2, 3. Are p
1
, p
2
, and p
3
orthogonal?
(b) Let q : [1, 1] R be a quadratic polynomial, and suppose that
q, p
1
= 7, q, p
2
= 2, and q, p
3
= 8.
What is q?
4. Let f : [, ] R be the function dened by
f(x) =
n=1
sin nx
2
n
=
sin x
2
+
sin 2x
4
+
sin 3x
8
+
sin 4x
16
+ .
a) Evaluate
f(x)
2
dx.
5. Let f : [, ] R be the function
f(x) =
1 if 0 x /2
0 otherwise.
Compute the Fourier series for f(x) by hand.
6. Use Wolfram Alpha to compute the Fourier series for cos(x/2) and e
x
on the
interval [, ].
7. Let g : S
1
R be the function g(x, y) = [y[. Find a formula for the harmonic
function f : D
2
S
2
that agrees with g on S
1
. (Feel free to use Wolfram Alpha
for the integrals.)