Download Fourier - People Server at UNCW

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Pi wikipedia , lookup

Trigonometric functions wikipedia , lookup

Transcript
5
Fourier Series
5.1 Introduction
In this chapter we will look at trigonometric series. Previously, we saw that
such series expansion occurred naturally in the solution of the heat equation
and other boundary value problems. In the last chapter we saw that such
functions could be viewed as a basis in an infinite dimensional vector space of
functions. Given a function in that space, when will it have a representation
as a trigonometric series? For what values of x will it converge? Finding such
series is at the heart of Fourier, or spectral, analysis.
There are many applications using spectral analysis. At the root of these
studies is the belief that many continuous waveforms are comprised of a number of harmonics. Such ideas stretch back to the Pythagorean study of the
vibrations of strings, which lead to their view of a world of harmony. This
idea was carried further by Johannes Kepler in his harmony of the spheres
approach to planetary orbits. In the 1700’s others worked on the superposition theory for vibrating waves on a stretched spring, starting with the wave
equation and leading to the superposition of right and left traveling waves.
This work was carried out by people such as John Wallis, Brook Taylor and
Jean le Rond d’Alembert.
In 1742 d’Alembert solved the wave equation
c2
∂2y
∂2y
−
= 0,
∂x2
∂t2
where y is the string height and c is the wave speed. However, his solution led
himself and others, like Leonhard Euler and Daniel Bernoulli, to investigate
what ”functions” could be the solutions of this equation. In fact, this lead
to a more rigorous approach to the study of analysis by first coming to grips
with the concept of a function. For example, in 1749 Euler sought the solution
for a plucked string in which case the initial condition y(x, 0) = h(x) has a
discontinuous derivative!
150
5 Fourier Series
In 1753 Daniel Bernoulli viewed the solutions as a superposition of simple
vibrations, or harmonics. Such superpositions amounted to looking at solutions of the form
X
kπx
kπct
cos
,
y(x, t) =
ak sin
L
L
k
where the string extends over the interval [0, L] with fixed ends at x = 0 and
x = L. However, the initial conditions for such superpositions are
y(x, 0) =
X
k
ak sin
kπx
.
L
It was determined that many functions could not be represented by a finite
number of harmonics, even for the simply plucked string given by an initial
condition of the form
cx,
0 ≤ x ≤ L/2
y(x, 0) =
.
c(L − x), L/2 ≤ x ≤ L
Thus, the solution consists generally of an infinite series of trigonometric functions.
Such series expansions were also of importance in Joseph Fourier’s solution
of the heat equation. The use of such Fourier expansions became an important
tool in the solution of linear partial differential equations, such as the wave
equation and the heat equation. As seen in the last chapter, using the Method
of Separation of Variables, allows higher dimensional problems to be reduced
to several one dimensional boundary value problems. However, these studies
lead to very important questions, which in turn opened the doors to whole
fields of analysis. Some of the problems raised were
1. What functions can be represented as the sum of trigonometric functions?
2. How can a function with discontinuous derivatives be represented by a
sum of smooth functions, such as the above sums?
3. Do such infinite sums of trigonometric functions a actually converge to
the functions they represents?
Sums over sinusoidal functions naturally occur in music and in studying
sound waves. A pure note can be represented as
y(t) = A sin(2πf t),
where A is the amplitude, f is the frequency in hertz (Hz), and t is time in
seconds. The amplitude is related to the volume, or intensity, of the sound.
The larger the amplitude, the louder the sound. In Figure 5.1 we show plots
of two such tones with f = 2 Hz in the top plot and f = 5 Hz in the bottom
one.
Next, we consider what happens when we add several pure tones. After all,
most of the sounds that we hear are in fact a combination of pure tones with
5.1 Introduction
151
y(t)=2 sin(4 π t)
4
y(t)
2
0
−2
−4
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
3.5
4
4.5
5
Time
y(t)=sin(10 π t)
4
y(t)
2
0
−2
−4
0
0.5
1
1.5
2
2.5
3
Time
Fig. 5.1. Plots of y(t) = sin(2πf t) on [0, 5] for f = 2 Hz and f = 5 Hz.
different amplitudes and frequencies. In Figure 5.2 we see what happens when
we add several sinusoids. Note that as one adds more and more tones with
different characteristics, the resulting signal gets more complicated. However,
we still have a function of time. In this chapter we will ask, “Given a function
f (t), can we find a set of sinusoidal functions whose sum converges to f (t)?”
Looking at the superpositions in Figure 5.2, we see that the sums yield
functions that appear to be periodic. This is not to be unexpected. We recall
that a periodic function is one in which the function values repeat over the
domain of the function. The length of the smallest part of the domain which
repeats is called the period. We can define this more precisely.
Definition 5.1. A function is said to be periodic with period T if f (t + T ) =
f (t) for all t and the smallest such positive number T is called the period.
For example, we consider the functions used in Figure 5.2. We began with
y(t) = 2 sin(4πt). Recall from your first studies of trigonometric functions that
one can determine the period by dividing the coefficient of t into 2π to get
the period. In this case we have
T =
1
2π
= .
4π
2
Looking at the top plot in Figure 5.1 we can verify this result. (You can count
the full number of cycles in the graph and divide this into the total time to
get a more accurate value of the period.)
In general, if y(t) = A sin(2πf t), the period is found as
T =
2π
1
= .
2πf
f
152
5 Fourier Series
y(t)=2 sin(4 π t)+sin(10 π t)
4
y(t)
2
0
−2
−4
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
4.5
5
Time
y(t)=2 sin(4 π t)+sin(10 π t)+0.5 sin(16 π t)
4
y(t)
2
0
−2
−4
0
0.5
1
1.5
2
2.5
3
3.5
4
Time
Fig. 5.2. Superposition of several sinusoids. Top: Sum of signals with f = 2 Hz and
f = 5 Hz. Bottom: Sum of signals with f = 2 Hz, f = 5 Hz, and and f = 8 Hz.
Of course, this result makes sense, as the unit of frequency, the hertz, is also
defined as s−1 , or cycles per second.
Returning to the superpositions in Figure 5.2, we have that y(t) =
sin(10πt) has a period of 0.2 Hz and y(t) = sin(16πt) has a period of 0.125 Hz.
The two superpositions retain the largest period of the signals added, which
is 0.5 Hz.
Our goal will be to start with a function and then determine the amplitudes
of the simple sinusoids needed to sum to that function. First of all, we will
see that this might involve an infinite number of such terms. Thus, we will be
studying an infinite series of sinusoidal functions.
Secondly, we will find that using just sine functions will not be enough
either. This is because we can add sinusoidal functions that do not necessarily
peak at the same time. We will consider two signals that originate at different
times. This is similar to when your music teacher would make sections of the
class sing a song like “Row, Row, Row your Boat” starting at slightly different
times.
We can easily add shifted sine functions. In Figure 5.3 we show the functions y(t) = 2 sin(4πt) and y(t) = 2 sin(4πt + 7π/8) and their sum. Note that
this shifted sine function can be written as y(t) = 2 sin(4π(t + 7/32)). Thus,
this corresponds to a time shift of −7/8.
So, we should account for shifted sine functions in our general sum. Of
course, we would then need to determine the unknown time shift as well as
the amplitudes of the sinusoidal functions that make up our signal, f (t). While
this is one approach that some researchers use to analyze signals, there is a
more common approach. This results from another reworking of the shifted
5.1 Introduction
153
function. Consider the general shifted function
y(t) = A sin(2πf t + φ).
Note that 2πf t + φ is called the phase of our sine function and φ is called the
phase shift. We can use our trigonometric identity for the sine of the sum of
two angles to obtain
y(t) = A sin(2πf t + φ) = A sin(φ) cos(2πf t) + A cos(φ) sin(2πf t).
Defining a = A sin(φ) and b = A cos(φ), we can rewrite this as
y(t) = a cos(2πf t) + b sin(2πf t).
Thus, we see that our signal is a sum of sine and cosine functions with the
same frequency and different amplitudes. If we can find a and b, then we can
easily determine A and φ:
p
b
A = a2 + b2 tan φ = .
a
y(t)=2 sin(4 π t) and y(t)=2 sin(4 π t+7π/8)
4
y(t)
2
0
−2
−4
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
4
4.5
5
Time
y(t)=2 sin(4 π t)+2 sin(4 π t+7π/8)
4
y(t)
2
0
−2
−4
0
0.5
1
1.5
2
2.5
3
3.5
Time
Fig. 5.3. Plot of the functions y(t) = 2 sin(4πt) and y(t) = 2 sin(4πt + 7π/8) and
their sum.
We are now in a position to state our goal in this chapter.
Goal
Given a signal f (t), we would like to determine its frequency content by
finding out what combinations of sines and cosines of varying frequencies
and amplitudes will sum to the given function. This is called Fourier Analysis.
154
5 Fourier Series
5.2 Fourier Trigonometric Series
As we have seen in the last section, we are interested in finding representations
of functions in terms of sines and cosines. Given a function f (x) we seek a
representation in the form
f (x) ∼
∞
a0 X
+
[an cos nx + bn sin nx] .
2
n=1
(5.1)
Notice that we have opted to drop reference to the frequency form of the
phase. This will lead to a simpler discussion for now and one can always make
the transformation nx = 2πfn t when applying these ideas to applications.
The series representation in Equation (5.1) is called a Fourier trigonometric series. We will simply refer to this as a Fourier series for now. The set of
constants a0 , an , bn , n = 1, 2, . . . are called the Fourier coefficients. The constant term is chosen in this form to make later computations simpler, though
some other authors choose to write the constant term as a0 . Our goal is to
find the Fourier series representation given f (x). Having found the Fourier
series representation, we will be interested in determining when the Fourier
series converges and to what function it converges.
From our discussion in the last section, we see that the infinite series is
periodic. The largest period of the terms comes from the n = 1 terms. The
periods of cos x and sin x are T = 2π. Thus, the Fourier series has period
2π. This means that the series should be able to represent functions that are
periodic of period 2π.
While this appears restrictive, we could also consider functions that are
defined over one period. In Figure 5.4 we show a function defined on [0, 2π].
In the same figure, we show its periodic extension. These are just copies of
the original function shifted by the period and glued together. The extension
can now be represented by a Fourier series and restricting the Fourier series
to [0, 2π] will give a representation of the original function. Therefore, we
will first consider Fourier series representations of functions defined on this
interval. Note that we could just as easily considered functions defined on
[−π, π] or any interval of length 2π.
Fourier Coefficients
Theorem 5.2. The Fourier series representation of f (x) defined on [0, 2π]
when it exists, is given by (5.1) with Fourier coefficients
an =
bn =
1
π
1
π
Z
Z
2π
f (x) cos nx dx,
n = 0, 1, 2, . . . ,
f (x) sin nx dx,
n = 1, 2, . . . .
0
2π
0
(5.2)
5.2 Fourier Trigonometric Series
155
f(x) on [0,2 π]
2
f(x)
1.5
1
0.5
0
−5
0
5
10
15
x
Periodic Extension of f(x)
2
f(x)
1.5
1
0.5
0
−5
0
5
10
15
x
Fig. 5.4. Plot of the functions f (t) defined on [0, 2π] and its periodic extension.
These expressions for the Fourier coefficients are obtained by considering
special integrations of the Fourier series. We will look at the derivations of
the an ’s. First we obtain a0 .
We begin by integrating the Fourier series term by term in Equation (5.1).
Z 2π
Z 2π
Z 2π X
∞
a0
f (x) dx =
dx +
[an cos nx + bn sin nx] dx.
(5.3)
2
0
0
0
n=1
We assume that we can integrate the infinite sum term by term. Then we
need to compute
Z 2π
a0
a0
dx = (2π) = πa0 ,
2
2
0
2π
Z 2π
sin nx
cos nx dx =
= 0,
n
0
0
2π
Z 2π
− cos nx
sin nx dx =
= 0.
n
0
0
(5.4)
From these results we see that only one term in the integrated sum does not
vanish leaving
Z 2π
f (x) dx = πa0 .
0
This confirms the value for a0 .
Next, we need to find an . We will multiply the Fourier series (5.1) by
cos mx for some positive integer m. This is like multiplying by cos 2x, cos 5x,
156
5 Fourier Series
etc. We are multiplying by all possible cos mx functions for different integers
m all at the same time. We will see that this will allow us to solve for the
an ’s.
We find the integrated sum of the series times cos mx is given by
Z 2π
Z 2π
a0
cos mx dx
f (x) cos mx dx =
2
0
0
Z 2π X
∞
+
[an cos nx + bn sin nx] cos mx dx. (5.5)
0
n=1
Integrating term by term, the right side becomes
Z
Z 2π
Z 2π
∞ X
a0 2π
cos mx dx +
an
cos nx cos mx dx + bn
sin nx cos mx dx .
2 0
0
0
n=1
(5.6)
R 2π
We have already established that 0 cos mx dx = 0, which implies that the
first term vanishes.
Next we need to compute integrals of products of sines and cosines. This
requires that we make use of some trigonometric identities. While you have
seen such integrals before in your calculus class, we will review how to carry
out such integrals. For future reference, we list several useful identities, some
of which we will prove along the way.
Useful Trigonometric Identities
sin(x ± y) = sin x cos y ± sin y cos x
(5.7)
cos(x ± y) = cos x cos y ∓ sin x sin y
(5.8)
1
sin2 x = (1 − cos 2x)
(5.9)
2
1
cos2 x = (1 + cos 2x)
(5.10)
2
1
sin x sin y = (cos(x − y) − cos(x + y))
(5.11)
2
1
cos x cos y = (cos(x + y) + cos(x − y))
(5.12)
2
1
sin x cos y = (sin(x + y) + sin(x − y))
(5.13)
2
R 2π
We first want to evaluate 0 cos nx cos mx dx. We do this by using the
product identity. We had done this in the last chapter, but will repeat the
derivation for the reader’s benefit. Recall the addition formulae for cosines:
cos(A + B) = cos A cos B − sin A sin B,
5.2 Fourier Trigonometric Series
157
cos(A − B) = cos A cos B + sin A sin B.
Adding these equations gives
2 cos A cos B = cos(A + B) + cos(A − B).
We can use this identity with A = mx and B = nx to complete the integration.
We have
Z 2π
Z
1 2π
cos nx cos mx dx =
[cos(m + n)x + cos(m − n)x] dx
2 0
0
2π
1 sin(m + n)x sin(m − n)x
+
=
2
m+n
m−n
0
= 0.
(5.14)
There is one caveat when doing such integrals. What if one of the denominators m ± n vanishes? For our problem m + n 6= 0, since both m and n
are positive integers. However, it is possible for m = n. This means that the
vanishing of the integral can only happen when m 6= n. So, what can we do
about the m = n case? One way is to start from scratch with our integration.
(Another way is to compute the limit as n approaches m in our result and use
L’Hopital’s Rule. Try it!)
R 2π
So, for n = m we have to compute 0 cos2 mx dx. This can also be handled
using a trigonometric identity. Recall that
cos2 θ =
1
(1 + cos 2θ.)
2
Inserting this into the integral, we find
Z 2π
Z
1 2π
cos2 mx dx =
(1 + cos2 2mx) dx
2
0
0
2π
1
1
=
x+
sin 2mx
2
2m
0
1
= (2π) = π.
2
To summarize, we have shown that
Z 2π
0, m 6= n
cos nx cos mx dx =
π,
m = n.
0
(5.15)
(5.16)
This holds true for m, n = 0, 1, . . . . [Why did we include m, n = 0?] When we
have such a set of functions, they are said to be an orthogonal set over the
integration interval.
Definition 5.3. A set of (real) functions {φn (x)} is said to be orthogonal on
Rb
[a, b] if a φn (x)φm (x) dx = 0 when n 6= m. Furthermore, if we also have that
Rb 2
φ (x) dx = 1, these functions are called orthonormal.
a n
158
5 Fourier Series
The set of functions {cos nx}∞
n=0 are orthogonal on [0, 2π]. Actually, they
are orthogonal on any interval√of length 2π. We can make them orthonormal
by dividing each function by π as indicated by Equation (5.15).
The notion of orthogonality is actually a generalization of the orthogonality
Rb
of vectors in finite dimensional vector spaces. The integral a f (x)f (x) dx is
the generalization of the dot product, and is called the scalar product of f (x)
and g(x), which are thought of as vectors in an infinite dimensional vector
space spanned by a set of orthogonal functions. But that is another topic for
later.
Returning to the evaluation of the integrals in equation (5.6), we still have
R 2π
to evaluate 0 sin nx cos mx dx. This can also be evaluated using trigonometric identities. In this case, we need an identity involving products of sines and
cosines. Such products occur in the addition formulae for sine functions:
sin(A + B) = sin A cos B + sin B cos A,
sin(A − B) = sin A cos B − sin B cos A.
Adding these equations, we find that
sin(A + B) + sin(A − B) = 2 sin A cos B.
Setting A = nx and B = mx, we find that
Z 2π
Z
1 2π
sin nx cos mx dx =
[sin(n + m)x + sin(n − m)x] dx
2 0
0
2π
1 − cos(n + m)x − cos(n − m)x
=
+
2
n+m
n−m
0
= (−1 + 1) + (−1 + 1) = 0.
(5.17)
For these integrals we also should be careful about setting n = m. In this
special case, we have the integrals
Z
2π
sin mx cos mx dx =
0
1
2
Z
2π
sin 2mx dx =
0
2π
1 − cos 2mx
= 0.
2
2m
0
Finally, we can finish our evaluation of (5.6). We have determined that all
but one integral vanishes. In that case, n = m. This leaves us with
Z 2π
f (x) cos mx dx = am π.
0
Solving for am gives
am =
1
π
Z
0
2π
f (x) cos mx dx.
5.2 Fourier Trigonometric Series
159
Since this is true for all m = 1, 2, . . . , we have proven this part of the theorem.
The only part left is finding the bn ’s This will be left as an exercise for the
reader.
We now consider examples of finding Fourier coefficients for given functions. In all of these cases we define f (x) on [0, 2π].
Example 5.4. f (x) = 3 cos 2x, x ∈ [0, 2π].
We first compute the integrals for the Fourier coefficients.
Z
1 2π
3 cos 2x dx = 0.
a0 =
π 0
Z
1 2π
an =
3 cos 2x cos nx dx = 0, n 6= 2.
π 0
Z
1 2π
a2 =
3 cos2 2x dx = 3,
π 0
Z
1 2π
bn =
3 cos 2x sin nx dx = 0, ∀n.
π 0
(5.18)
Therefore, we have that the only nonvanishing coefficient is a2 = 3. So there
is one term and f (x) = 3 cos 2x. Well, we should have know this before doing
all of these integrals. So, if we have a function expressed simply in terms of
sums of simple sines and cosines, then it should be easy to write down the
Fourier coefficients without much work.
Example 5.5. f (x) = sin2 x, x ∈ [0, 2π].
We could determine the Fourier coefficients by integrating as in the last
example. However, it is easier to use trigonometric identities. We know that
sin2 x =
1 1
1
(1 − cos 2x) = − cos 2x.
2
2 2
There are no sine terms, so bn = 0, n = 1, 2, . . . . There is a constant term,
implying a0 /2 = 1/2. So, a0 = 1. There is a cos 2x term, corresponding to
n = 2, so a2 = − 21 . That leaves an = 0 for n 6= 0, 2.
1, 0 < x < π,
Example 5.6. f (x) =
.
−1, π < x < 2π,
This example will take a little more work. We cannot bypass evaluating
any integrals at this time. This function is discontinuous, so we will have to
compute each integral by breaking up the integration into two integrals, one
over [0, π] and the other over [π, 2π].
a0 =
1
π
Z
2π
f (x) dx
0
160
5 Fourier Series
Z
Z
1 π
1 2π
dx +
(−1) dx
=
π 0
π π
1
1
= (π) + (−2π + π) = 0.
π
π
an =
=
1
π
1
π
1
=
π
Z
(5.19)
2π
f (x) cos nx dx
0
Z
Z
π
"0
cos nx dx −
2π
π
cos nx dx
#
π 1
1
sin nx −
sin nx
n
n
0
2π
π
= 0.
1
bn =
π
1
=
π
=
1
π
(5.20)
Z
2π
f (x) sin nx dx
0
Z
"0
π
sin nx dx −
Z
2π
π
sin nx dx
π 2π #
1
1
− cos nx +
cos nx
n
n
0
π
1
1
1
1
− cos nπ + + − cos nπ
n
n n n
1
π
2
=
(1 − cos nπ).
nπ
=
(5.21)
We have found the Fourier coefficients for this function. Before inserting
them into the Fourier series (5.1), we note that cos nπ = (−1)n . Therefore,
0, n even
1 − cos nπ =
(5.22)
2, n odd.
So, half of the bn ’s are zero. While we could write the Fourier series representation as
∞
4 X 1
f (x) ∼
sin nx,
π
n
n=1, odd
we could let n = 2k − 1 and write
f (x) =
∞
4 X sin(2k − 1)x
,
π
2k − 1
k=1
But does this series converge? Does it converge to f (x)? We will discuss
this question later in the chapter.
5.3 Fourier Series Over Other Intervals
161
5.3 Fourier Series Over Other Intervals
In many applications we are interested in determining Fourier series representations of functions defined on intervals other than [0, 2π]. In this section we
will determine the form of the series expansion and the Fourier coefficients in
these cases.
The most general type of interval is given as [a, b]. However, this often is too
general. More common intervals are of the form [−π, π], [0, L], or [−L/2, L/2].
The simplest generalization is to the interval [0, L]. Such intervals arise often
in applications. For example, one can study vibrations of a one dimensional
string of length L and set up the axes with the left end at x = 0 and the
right end at x = L. Another problem would be to study the temperature
distribution along a one dimensional rod of length L. Such problems lead to
the original studies of Fourier series. As we will see later, symmetric intervals,
[−a, a], are also useful.
Given an interval [0, L], we could apply a transformation to an interval of
length 2π by simply rescaling our interval. Then we could apply this transformation to our Fourier series representation to obtain an equivalent one useful
for functions defined on [0, L].
We define x ∈ [0, 2π] and t ∈ [0, L]. A linear transformation relating these
intervals is simply x = 2πt
L as shown in Figure 5.5. So, t = 0 maps to x = 0
and t = L maps to x = 2π. Furthermore, this transformation maps f (x) to
a new function g(t) = f (x(t)), which is defined on [0, L]. We will determine
the Fourier series representation of this function using the representation for
f (x).
Fig. 5.5. A sketch of the transformation between intervals x ∈ [0, 2π] and t ∈ [0, L].
Recall the form of the Fourier representation for f (x) in Equation (5.1):
f (x) ∼
∞
a0 X
+
[an cos nx + bn sin nx] .
2
n=1
Inserting the transformation relating x and t, we have
∞ 2nπt
2nπt
a0 X
g(t) ∼
+
an cos
+ bn sin
.
2
L
L
n=1
(5.23)
(5.24)
This gives the form of the series expansion for g(t) with t ∈ [0, L]. But, we
still need to determine the Fourier coefficients.
162
5 Fourier Series
Recall, that
an =
1
π
Z
2π
Z
L
f (x) cos nx dx.
0
We need to make a substitution in the integral of x = 2πt
L . We also will need
to transform the differential, dx = 2π
dt.
Thus,
the
resulting
form for our
L
coefficient is
Z
2 L
2nπt
g(t) cos
dt.
(5.25)
an =
L 0
L
Similarly, we find that
bn =
2
L
0
g(t) sin
2nπt
dt.
L
(5.26)
We note first that when L = 2π we get back the series representation that
we first studied. Also, the period of cos 2nπt
is L/n, which means that the
L
representation for g(t) has a period of L.
At the end of this section we present the derivation of the Fourier series
representation for a general interval for the interested reader. In Table 5.1 we
summarize some commonly used Fourier series representations.
We will end our discussion for now with some special cases and an example
for a function defined on [−π, π].
Example 5.7. Let f (x) = |x| on [−π, π] We compute the coefficients, beginning
as usual with a0 . We have
Z
1 π
|x| dx
a0 =
π −π
Z π
2
=
|x| dx = π
(5.33)
π 0
At this point we need to remind the reader about the integration of even
and odd functions.
1. Even Functions: In this evaluation we made use of the fact that the
integrand is an even function. Recall that f (x) is an even function if
f (−x) = f (x) for all x. One can recognize even functions as they are
symmetric with respect to the y-axis as shown in Figure 5.6(A). If one
integrates an even function over a symmetric interval, then one has that
Z a
Z a
f (x) dx = 2
f (x) dx.
(5.34)
−a
0
One can prove this by splitting off the integration over negative values of
x, using the substitution x = −y, and employing the evenness of f (x).
Thus,
5.3 Fourier Series Over Other Intervals
163
Table 5.1. Special Fourier Series Representations on Different Intervals
Fourier Series on [0, L]
∞
h
i
2nπx
2nπx
a0 X
+
an cos
+ bn sin
.
2
L
L
f (x) ∼
n=1
2
an =
L
bn =
2
L
Z
L
f (x) cos
2nπx
dx.
L
n = 0, 1, 2, . . . ,
f (x) sin
2nπx
dx.
L
n = 1, 2, . . . .
0
Z
L
0
(5.27)
(5.28)
Fourier Series on [− L2 , L2 ]
∞
f (x) ∼
n=1
an =
bn =
h
i
a0 X
2nπx
2nπx
+
an cos
+ bn sin
.
2
L
L
2
L
2
L
Z
Z
L
2
f (x) cos
2nπx
dx.
L
n = 0, 1, 2, . . . ,
f (x) sin
2nπx
dx.
L
n = 1, 2, . . . .
−L
2
L
2
−L
2
(5.29)
(5.30)
Fourier Series on [−π, π]
∞
a0 X
+
[an cos nx + bn sin nx] .
2
f (x) ∼
(5.31)
n=1
an =
bn =
Z
1
π
1
π
Z
π
f (x) cos nx dx.
n = 0, 1, 2, . . . ,
f (x) sin nx dx.
n = 1, 2, . . . .
−π
π
Z
a
−a
(5.32)
−π
f (x) dx =
Z
0
f (x) dx +
−a
Z
Z
a
f (x) dx
0
0
Z
a
=−
f (−y) dy +
f (x) dx
Z aa
Z a 0
=
f (y) dy +
f (x) dx
0
0
Z a
=2
f (x) dx.
0
(5.35)
164
5 Fourier Series
This can be visually verified by looking at Figure 5.6(A).
2. Odd Functions: A similar computation could be done for odd functions.
f (x) is an odd function if f (−x) = −f (x) for all x. The graphs of such
functions are symmetric with respect to the origin as shown in Figure
5.6(B). If one integrates an odd function over a symmetric interval, then
one has that
Z a
f (x) dx = 0.
(5.36)
−a
Fig. 5.6. Examples of the areas under (A) even and (B) odd functions on symmetric
intervals, [−a, a].
We now continue with our computation of the Fourier coefficients for
f (x) = |x| on [−π, π]. We have
Z
Z
2 π
1 π
an =
|x| cos nx dx =
x cos nx dx.
(5.37)
π −π
π 0
Here we have made use of the fact that |x| cos nx is an even function. In order
to compute the resulting integral, we need to use integration by parts,
Z b
b Z b
u dv = uv −
v du,
a
a
a
by letting u = x and dv = cos nx dx. Thus, du = dx and v =
Continuing with the computation, we have
Z
2 π
an =
x cos nx dx.
π 0
π 1 Z π
2 1
=
x sin nx −
sin nx dx
π n
n 0
0
π
2
1
=−
− cos nx
nπ
n
0
2
n
= − 2 (1 − (−1) ).
πn
R
dv =
1
n
sin nx.
(5.38)
5.3 Fourier Series Over Other Intervals
165
Here we have used the fact that cos nπ = (−1)n for any integer n. This lead
to a factor (1 − (−1)n ). This factor can be simplified as
2, n odd
n
1 − (−1) =
.
(5.39)
0, n even
4
So, an = 0 for n even and an = − πn
2 for n odd.
Computing the bn ’s is simpler. We note that we have to integrate |x| sin nx
from x = −π to π. The integrand is an odd function and this is a symmetric
interval. So, the result is that bn = 0 for all n.
Putting this all together, the Fourier series representation of f (x) = |x| on
[−π, π] is given as
∞
π
4 X cos nx
.
(5.40)
f (x) ∼ −
2
π
n2
n=1, odd
While this is correct, we can rewrite the sum over only odd n by reindexing.
We let n = 2k − 1 for k = 1, 2, 3, . . . . Then we only get the odd integers. The
series can then be written as
f (x) ∼
∞
π
4 X cos(2k − 1)x
−
.
2
π
(2k − 1)2
(5.41)
k=1
Throughout our discussion we have referred to such results as Fourier
representations. We have not looked at the convergence of these series. Here
is an example of an infinite series of functions. What does this series sum to?
We show in Figure 5.7 the first few partial sums. They appear to be converging
to f (x) = |x| fairly quickly.
Even though f (x) was defined on [−π, π] we can still evaluate the Fourier
series at values of x outside this interval. In Figure 5.8, we see that the representation agrees with f (x) on the interval [−π, π]. Outside this interval we
have a periodic extension of f (x) with period 2π.
Another example is the Fourier series representation of f (x) = x on [−π, π]
as left for Problem 5.1. This is determined to be
f (x) ∼ 2
∞
X
(−1)n+1
sin nx.
n
n=1
(5.42)
As seen in Figure 5.9 we again obtain the periodic extension of our function.
In this case we needed many more terms. Also, the vertical parts of the first
plot are nonexistent. In the second plot we only plot the points and not the
typical connected points that most software packages plot as the default style.
Example 5.8. It is interesting to note that one can use Fourier series to obtain
sums of some infinite series. For example, in the last example we found that
∞
X
(−1)n+1
x∼2
sin nx.
n
n=1
166
5 Fourier Series
Partial Sum with One Term
Partial Sum with Two Terms
4
4
3
3
2
2
1
1
0
−2
0
0
2
x
Partial Sum with Three Terms
4
3
3
2
2
1
1
−2
0
0
2
x
Partial Sum with Four Terms
4
0
−2
0
2
−2
0
x
2
x
Fig. 5.7. Plot of the first partial sums of the Fourier series representation for f (x) =
|x|.
Periodic Extension with 10 Terms
4
3.5
3
2.5
2
1.5
1
0.5
0
−6
−4
−2
0
2
4
6
8
10
12
x
Fig. 5.8. Plot of the first 10 terms of the Fourier series representation for f (x) = |x|
on the interval [−2π, 4π].
Now, what if we chose x =
∞
X
π
2?
π
(−1)n+1
=2
2
n
n=1
Then, we have
nπ
1 1 1
sin
= 2 1 − + − + ... .
2
3 5 7
This gives a well known expression for π:
5.3 Fourier Series Over Other Intervals
167
Periodic Extension with 10 Terms
4
2
0
−2
−4
−6
−4
−2
0
2
4
6
8
10
12
10
12
x
Periodic Extension with 200 Terms
4
2
0
−2
−4
−6
−4
−2
0
2
4
6
8
x
Fig. 5.9. Plot of the first 10 terms and 200 terms of the Fourier series representation
for f (x) = x on the interval [−2π, 4π].
1 1 1
π = 4 1 − + − + ... .
3 5 7
5.3.1 Fourier Series on [a, b]
A Fourier series representation is also possible for a general interval, t ∈ [a, b].
As before, we just need to transform this interval to [0, 2π]. Let
x = 2π
t−a
.
b−a
Inserting this into the Fourier series (5.1) representation for f (x) we obtain
g(t) ∼
∞ a0 X
2nπ(t − a)
2nπ(t − a)
+
an cos
+ bn sin
.
2
b−a
b−a
n=1
(5.43)
Well, this expansion is ugly. It is not like the last example, where the
transformation was straightforward. If one were to apply the theory to applications, it might seem to make sense to just shift the data so that a = 0 and
be done with any complicated expressions. However, mathematics students
enjoy the challenge of developing such generalized expressions. So, let’s see
what is involved.
First, we apply the addition identities for trigonometric functions and
rearrange the terms.
168
5 Fourier Series
∞ 2nπ(t − a)
a0 X
2nπ(t − a)
+
an cos
+ bn sin
2
b−a
b−a
n=1
∞
a0 X
2nπt
2nπa
2nπt
2nπa
=
+
an cos
cos
+ sin
sin
2
b−a
b−a
b−a
b−a
n=1
2nπt
2nπa
2nπt
2nπa
cos
− cos
sin
+ bn sin
b−a
b−a
b−a
b−a
∞ X
a0
2nπt
2nπa
2nπa
=
+
cos
an cos
− bn sin
2
b−a
b−a
b−a
n=1
2nπt
2nπa
2nπa
an sin
+ bn cos
.
(5.44)
+ sin
b−a
b−a
b−a
g(t) ∼
Defining A0 = a0 and
2nπa
2nπa
− bn sin
b−a
b−a
2nπa
2nπa
+ bn cos
,
Bn ≡ an sin
b−a
b−a
An ≡ an cos
(5.45)
we arrive at the more desirable form for the Fourier series representation of a
function defined on the interval [a, b].
∞ A0 X
2nπt
2nπt
g(t) ∼
+
An cos
+ Bn sin
.
2
b−a
b−a
n=1
(5.46)
We next need to find expressions for the Fourier coefficients. We insert the
known expressions for an and bn and rearrange. First, we note that under the
t−a
transformation x = 2π b−a
we have
an =
=
1
π
Z
2π
f (x) cos nx dx
0
2
b−a
Z
b
g(t) cos
a
2nπ(t − a)
dt,
b−a
(5.47)
and
1
bn =
π
=
Z
2π
f (x) cos nx dx
0
2
b−a
Z
a
b
g(t) sin
2nπ(t − a)
dt.
b−a
(5.48)
Then, inserting these integrals in An , combining integrals and making use of
the addition formula for the cosine of the sum of two angles, we obtain
5.4 Sine and Cosine Series
169
2nπa
2nπa
− bn sin
b−a
b−a
Z b
2
2nπ(t − a)
2nπa
2nπ(t − a)
2nπa
=
g(t) cos
cos
− sin
sin
dt
b−a a
b−a
b−a
b−a
b−a
Z b
2
2nπt
=
g(t) cos
dt.
(5.49)
b−a a
b−a
An ≡ an cos
A similar computation gives
Bn =
2
b−a
Z
b
g(t) sin
a
2nπt
dt.
b−a
(5.50)
Summarizing, we have shown that:
Theorem 5.9. The Fourier series representation of f (x) defined
on [a, b] when it exists, is given by
f (x) ∼
∞ a0 X
2nπx
2nπx
+
an cos
+ bn sin
.
2
b−a
b−a
n=1
(5.51)
with Fourier coefficients
an =
bn =
2
b−a
2
b−a
Z
b
f (x) cos
a
Z
b
f (x) sin
a
2nπx
dx.
b−a
2nπx
dx.
b−a
n = 0, 1, 2, . . . ,
n = 1, 2, . . . .
(5.52)
5.4 Sine and Cosine Series
In the last two examples (f (x) = |x| and f (x) = x on [−π, π]) we have seen
Fourier series representations that contain only sine or cosine terms. As we
know, the sine functions are odd functions and thus sum to odd functions.
Similarly, cosine functions sum to even functions. Such occurrences happen
often in practice. Fourier representations involving just sines are called sine
series and those involving just cosines (and the constant term) are called cosine
series.
Another interesting result, based upon these examples, is that the original
functions, |x| and x agree on the interval [0, π]. Note from Figures 5.7-5.9 that
their Fourier series representations do as well. Thus, more than one series can
be used to represent functions defined on finite intervals. All they need to do
is to agree with the function over that particular interval. Sometimes one of
these series is more useful because it has additional properties needed in the
given application.
We have made the following observations from the previous examples:
170
5 Fourier Series
1. There are several trigonometric series representations for a function defined on a finite interval.
2. Odd functions on a symmetric interval are represented by sine series and
even functions on a symmetric interval are represented by cosine series.
These two observations are related and are the subject of this section.
We begin by defining a function f (x) on interval [0, L]. We have seen that the
Fourier series representation of this function appears to converge to a periodic
extension of the function.
In Figure 5.10 we show a function defined on [0, 1]. To the right is its
periodic extension to the whole real axis. This representation has a period of
L = 1. The bottom left plot is obtained by first reflecting f about the y-axis
to make it an even function and then graphing the periodic extension of this
new function. Its period will be 2L = 2. Finally, in the last plot we flip the
function about each axis and graph the periodic extension of the new odd
function. It will also have a period of 2L = 2.
f(x) on [0,1]
Periodic Extension of f(x)
1.5
1
1
0.5
0.5
f(x)
f(x)
1.5
0
−0.5
−1
−1
−1.5
−1
−1.5
−1
0
1
2
3
x
Even Periodic Extension of f(x)
1
2
3
1.5
1
0.5
0.5
f(x)
1
0
−0.5
0
−0.5
−1
−1.5
−1
0
x
Odd Periodic Extension of f(x)
1.5
f(x)
0
−0.5
−1
0
1
x
2
3
−1.5
−1
0
1
2
3
x
Fig. 5.10. This is a sketch of a function and its various extensions. The original
function f (x) is defined on [0, 1] and graphed in the upper left corner. To its right is
the periodic extension, obtained by adding replicas. The two lower plots are obtained
by first making the original function even or odd and then creating the periodic
extensions of the new function.
In general, we obtain three different periodic representations. In order
to distinguish these we will refer to them simply as the periodic, even and
odd extensions. Now, starting with f (x) defined on [0, L], we would like to
determine the Fourier series representations leading to these extensions. [For
easy reference, the results are summarized in Table 5.2] We have already seen
5.4 Sine and Cosine Series
171
that the periodic extension of f (x) is obtained through the Fourier series
representation in Equation (5.53).
Table 5.2. Fourier Cosine and Sine Series Representations on [0, L]
Fourier Series on [0, L]
∞
f (x) ∼
h
i
a0 X
2nπx
2nπx
+
an cos
+ bn sin
.
2
L
L
n=1
2
an =
L
bn =
2
L
Z
L
f (x) cos
2nπx
dx.
L
n = 0, 1, 2, . . . ,
f (x) sin
2nπx
dx.
L
n = 1, 2, . . . .
0
Z
L
0
(5.53)
(5.54)
Fourier Cosine Series on [0, L]
f (x) ∼ a0 /2 +
∞
X
nπx
.
L
(5.55)
n = 0, 1, 2, . . . .
(5.56)
an cos
n=1
where
an =
2
L
Z
L
f (x) cos
0
nπx
dx.
L
Fourier Sine Series on [0, L]
f (x) ∼
∞
X
n=1
where
2
bn =
L
Z
0
L
f (x) sin
bn sin
nπx
.
L
nπx
dx.
L
n = 1, 2, . . . .
(5.57)
(5.58)
Given f (x) defined on [0, L], the even periodic extension is obtained by
simply computing the Fourier series representation for the even function
f (x), 0 < x < L,
fe (x) ≡
(5.59)
f (−x) −L < x < 0.
Since fe (x) is an even function on a symmetric interval [−L, L], we expect
that the resulting Fourier series will not contain sine terms. Therefore, the
series expansion will be given by [Use the general case in (5.51) with a = −L
and b = L.]:
172
5 Fourier Series
fe (x) ∼
∞
nπx
a0 X
+
an cos
.
2
L
n=1
with Fourier coefficients
Z
1 L
nπx
fe (x) cos
dx. n = 0, 1, 2, . . . .
an =
L −L
L
(5.60)
(5.61)
However, we can simplify this by noting that the integrand is even and the
interval of integration can be replaced by [0, L]. On this interval fe (x) = f (x).
So, we have the Cosine Series Representation of f (x) for x ∈ [0, L] is given as
f (x) ∼
where
an =
2
L
Z
∞
a0 X
nπx
+
an cos
.
2
L
n=1
L
f (x) cos
0
nπx
dx.
L
n = 0, 1, 2, . . . .
(5.62)
(5.63)
Similarly, given f (x) defined on [0, L], the odd periodic extension is obtained by simply computing the Fourier series representation for the odd
function
f (x), 0 < x < L,
fo (x) ≡
(5.64)
−f (−x) −L < x < 0.
The resulting series expansion leads to defining the Sine Series Representation
of f (x) for x ∈ [0, L] as
f (x) ∼
where
2
bn =
L
Z
0
∞
X
n=1
L
f (x) sin
bn sin
nπx
.
L
nπx
dx.
L
n = 1, 2, . . . .
(5.65)
(5.66)
Example 5.10. In Figure 5.10 we actually provided plots of the various extensions of the function f (x) = x2 for x ∈ [0, 1]. Let’s determine the representations of the periodic, even and odd extensions of this function.
For a change, we will use a CAS (Computer Algebra System) package to
do the integrals. In this case we can use Maple. A general code for doing this
for the periodic extension is shown in Table 5.3.
Example 5.11. Periodic Extension - Trigonometric Fourier Series
1
Using the above code, we have that a0 = 32 an = n21π2 and bn = − nπ
.
Thus, the resulting series is given as
∞ 1 X
1
1
f (x) ∼ +
cos 2nπx −
sin 2nπx .
3 n=1 n2 π 2
nπ
5.4 Sine and Cosine Series
173
Table 5.3. Maple code for computing Fourier coefficients and plotting partial sums
of the Fourier series.
>
>
>
>
>
restart:
L:=1:
f:=x^2:
assume(n,integer):
a0:=2/L*int(f,x=0..L);
a0 := 2/3
> an:=2/L*int(f*cos(2*n*Pi*x/L),x=0..L);
1
an := ------2
2
n~ Pi
> bn:=2/L*int(f*sin(2*n*Pi*x/L),x=0..L);
1
bn := - ----n~ Pi
> F:=a0/2+sum((1/(k*Pi)^2)*cos(2*k*Pi*x/L)
-1/(k*Pi)*sin(2*k*Pi*x/L),k=1..50):
> plot(F,x=-1..3,title=‘Periodic Extension‘,
titlefont=[TIMES,ROMAN,14],font=[TIMES,ROMAN,14]);
In Figure 5.11 we see the sum of the first 50 terms of this series. Generally,
we see that the series seems to be converging to the periodic extension of f .
There appear to be some problems with the convergence around integer values
of x. We will later see that this is because of the discontinuities in the periodic
extension and the resulting overshoot is referred to as the Gibbs phenomenon
which is discussed in the appendix.
Example 5.12. Even Periodic Extension - Cosine Series
n
In this case we compute a0 = 23 and an = 4(−1)
n2 π 2 . Therefore, we have
f (x) ∼
∞
1
4 X (−1)n
+ 2
cos nπx.
3 π n=1 n2
In Figure 5.12 we see the sum of the first 50 terms of this series. In this
case the convergence seems to be much better than in the periodic extension
case. We also see that it is converging to the even extension.
Example 5.13. Odd Periodic Extension - Sine Series
Finally, we look at the sine series for this function. We find that bn =
− n32π3 (n2 π 2 (−1)n − 2(−1)n + 2). Therefore,
174
5 Fourier Series
Periodic Extension
1
0.8
0.6
0.4
0.2
–1
0
1
2
3
x
Fig. 5.11. The periodic extension of f (x) = x2 on [0, 1].
∞
2 X 1 2 2
f (x) ∼ − 3
(n π (−1)n − 2(−1)n + 2) sin nπx.
π n=1 n3
Even Periodic Extension
1
0.8
0.6
0.4
0.2
–1
0
1
2
3
x
Fig. 5.12. The even periodic extension of f (x) = x2 on [0, 1].
5.5 Appendix: The Gibbs Phenomenon
175
Once again we see discontinuities in the extension as seen in Figure 5.13.
However, we have verified that our sine series appears to be converging to the
odd extension as we first sketched in Figure 5.10.
Odd Periodic Extension
1
0.5
–1
0
1
2
3
x
–0.5
–1
Fig. 5.13. The odd periodic extension of f (x) = x2 on [0, 1].
5.5 Appendix: The Gibbs Phenomenon
We have seen that when there is a jump discontinuity in the periodic extension of our functions, whether the function originally had a discontinuity or
developed one due to a mismatch in the values of the endpoints. This can
be seen in Figures 5.9, 5.11 and 5.13. The Fourier series has a difficult time
converging at the point of discontinuity and these graphs of the Fourier series
show a distinct overshoot which does not go away. This is called the Gibbs
phenomenon and the amount of overshoot can be computed.
In one of our first examples, Example 5.6, we found the Fourier series
representation of the piecewise defined function
1, 0 < x < π,
f (x) =
−1, π < x < 2π,
to be
176
5 Fourier Series
f (x) ∼
∞
4 X sin(2k − 1)x
.
π
2k − 1
k=1
In Figure 5.14 we display the sum of the first ten terms. Note the wiggles,
overshoots and under shoots near x = 0, ±π. These are seen more when we
plot the representation for x ∈ [−3π, 3π], as shown in Figure 5.15. We note
that the overshoots and undershoots occur at discontinuities in the periodic
extension of f (x). These occur whenever f (x) has a discontinuity or if the
values of f (x) at the endpoints of the domain do not agree.
One might expect that we only need to add more terms. In Figure 5.16 we
show the sum for twenty terms. Note the sum appears to converge better for
points far from the discontinuities. But, the overshoots and undershoots are
still present. In Figures 5.17 and 5.18 show magnified plots of the overshoot
at x = 0 for N = 100 and N = 500, respectively. We see that the overshoot
persists. The peak is at about the same height, but its location seems to be
getting closer to the origin. We will show how one can estimate the size of the
overshoot.
Gibbs Phenomenon N=10
1
0.5
–3
–2
–1
1
2
3
x
–0.5
–1
Fig. 5.14. The Fourier series representation of a step function on [−π, π] for N = 10.
We can study the Gibbs phenomenon by looking at the partial sums of
general Fourier trigonometric series for functions f (x) defined on the interval
[−L, L]. Writing out the partial sums, inserting the Fourier coefficients and
rearranging, we have
5.5 Appendix: The Gibbs Phenomenon
177
Gibbs Phenomenon N=10
1
0.5
–8
–6
–4
–2
0
2
4
6
8
x
–0.5
–1
Fig. 5.15. The Fourier series representation of a step function on [−π, π] for N = 10
plotted on [−3π, 3π] displaying the periodicity.
SN (x) = a0 +
N h
X
nπx
nπx i
an cos
+ bn sin
L
L
n=1
Gibbs Phenomenon N=20
1
0.5
–3
–2
–1
0
1
2
3
x
–0.5
–1
Fig. 5.16. The Fourier series representation of a step function on [−π, π] for N = 20.
178
5 Fourier Series
Gibbs Phenomenon N=100
1.2
1
0.8
0.6
0.4
0.2
0
0.01
0.02
0.03
0.04
x
0.05
0.06
0.07
Fig. 5.17. The Fourier series representation of a step function on [−π, π] for N =
100.
!
Z
1 L
nπy
nπx
f (y) dy +
f (y) cos
dy cos
L
L
L
−L
−L
n=1
!
#
Z L
1
nπy
nπx
+
f (y) sin
dy sin
L −L
L
L
)
ZL (
N
1
1 X
nπy
nπx
nπy
nπx =
+
cos
cos
+ sin
sin
f (y) dy
L
2 n=1
L
L
L
L
1
=
2L
Z
N
X
L
"
−L
1
=
L
ZL (
−L
1
≡
L
ZL
N
1 X
nπ(y − x)
+
cos
2 n=1
L
)
f (y) dy
DN (y − x)f (y) dy.
(5.67)
−L
We have defined
N
DN (x) =
1 X
nπx
+
cos
,
2 n=1
L
which is called the N-th Dirichlet Kernel. We now prove
5.5 Appendix: The Gibbs Phenomenon
179
Gibbs Phenomenon N=500
1.2
1
0.8
0.6
0.4
0.2
0
0.01
0.02
0.03
0.04
x
0.05
0.06
0.07
Fig. 5.18. The Fourier series representation of a step function on [−π, π] for N =
500.
Proposition:
Dn (x) =
Proof: Let θ =
πx
L
(
sin((n+ 21 ) πx
L )
,
2 sin πx
2L
n + 12 ,
πx
sin 2L
6 0
=
.
πx
sin 2L
=0
and multiply Dn (x)by 2 sin 2θ to obtain:
θ 1
θ
2 sin Dn (x) = 2 sin
+ cos θ + · · · + cos nθ
2
2 2
θ
θ
θ
θ
= sin + 2 cos θ sin + 2 cos 2θ sin + · · · + 2 cos nθ sin
2 2
2
2
θ
3θ
θ
5θ
3θ
= sin + sin
− sin
+ sin
− sin
+ ···
2
2
2
2
2
1
1
+ sin n +
θ − sin n −
θ
2
2
1
= sin n +
θ.
(5.68)
2
Thus,
θ
1
2 sin Dn (x) = sin n +
θ,
2
2
or if sin θ2 6= 0,
Dn (x) =
sin n +
2 sin
1
2
θ
2
θ
,
θ=
πx
.
L
If sin θ2 = 0,then one needs to apply L’Hospital’s Rule:
sin n + 12 θ
(n + 21 ) cos n + 12 θ
lim
= lim
θ→2mπ
θ→2mπ
2 sin θ2
cos θ2
(n + 12 ) cos (2mnπ + mπ)
cos mπ
1
= n+ .
2
=
(5.69)
We further note that DN (x) is periodic with period 2L and is an
even function.
180
5 Fourier Series
So far, we have found that
ZL
1
SN (x) =
L
DN (y − x)f (y) dy.
(5.70)
−L
Now, make the substitution ξ = y − x. Then,
1
SN (x) =
L
=
1
L
Z
L−x
DN (ξ)f (ξ + x) dξ
−L−x
Z L
DN (ξ)f (ξ + x) dξ.
(5.71)
−L
In the second integral we have made use of the fact that f (x) and DN (x) are
periodic with period 2L and shifted the interval back to [−L, L].
Now split the integration and use the fact that DN (x) is an even function.
Then,
Z
1 L
DN (ξ)f (ξ + x) dξ +
DN (ξ)f (ξ + x) dξ
L 0
−L
Z
1 L
[f (x − ξ) + f (ξ + x)] DN (ξ) dξ.
=
L 0
1
SN (x) =
L
Z
0
(5.72)
We can use this result to study the Gibbs phenomenon whenever it occurs.
In particular, we will only concentrate on our earlier example. Namely,
1, 0 < x < π,
f (x) =
−1, π < x < 2π,
For this case, we have
SN (x) =
1
π
Z
π
0
[f (x − ξ) + f (ξ + x)] DN (ξ) dξ
for
N
DN (x) =
Also, one can show that
Thus, we have
1 X
+
cos nx.
2 n=1

0 ≤ ξ < x,
 2,
0, x ≤ ξ < π − x,
f (x − ξ) + f (ξ + x) =

−2, π − x ≤ ξ < π.
(5.73)
5.5 Appendix: The Gibbs Phenomenon
Z
2 x
2 π
DN (ξ) dξ −
DN (ξ) dξ
π 0
π π−x
Z x
Z x
2
2
DN (z) dz +
DN (π − z) dz.
=
π 0
0
SN (x) =
181
Z
(5.74)
Here we made the substitution z = π − ξ in the second integral. The Dirichlet
kernel in the proposition for L = π is given by
DN (x) =
For N large, we have N +
under these assumptions,
1
2
sin(N + 12 )x
.
2 sin x2
≈ N, and for small x, we have sin x2 ≈
DN (x) ≈
Therefore,
2
SN (x) →
π
Z
0
x
2.
So,
sin N x
.
x
x
sin N ξ
dξ.
ξ
If we want to determine the locations of the minima and maxima, where
the undershoot and overshoot occur, then we apply the first derivative test
for extrema to SN (x). Thus,
2 sin N x
d
SN (x) =
= 0.
dx
π x
The extrema occur for N x = mπ, m = ±1, ±2, . . . . One can show that there
is a maximum at x = π/N and a minimum for x = 2π/N. The value for the
overshoot can be computed as
Z
2 π/N sin N ξ
dξ
π 0
ξ
Z
2 π sin t
dt
=
π 0
t
2
= Si(π)
π
= 1.178979744 . . ..
SN (π/N ) =
(5.75)
Note that this value is independent of N and is given in terms of the sine
integral,
Z x
sin t
Si(x) ≡
dt.
t
0
182
5 Fourier Series
Problems
5.1. Find the Fourier Series of each function f (x) of period 2π. For each series,
plot the N th partial sum,
N
SN =
a0 X
+
[an cos nx + bn sin nx] ,
2
n=1
for N = 5, 10, 50 and describe the convergence (is it fast? what is it converging
to, etc.) [Some simple Maple code for computing partial sums is shown below.]
a. f (x) = x, |x| < π.
2
b. f (x) = x4 , |x| < π.
c. f (x) = π
−π|x|, |x| < π.
2 , 0 < x < π,
d. f (x) =
π
−
2 , π < x < 2π.
0, −π < x < 0,
e. f (x) =
1, 0 < x < π.
A simple set of commands in Maple are shown below, where you fill in the
Fourier coefficients that you have computed by hand and f (x) so that you
can compare your results. Of course, other modifications may be needed.
>
>
>
>
restart:
f:=x:
F:=a0/2+sum(an*cos(n*x)+bn*sin(n*x),n=1..N):
N:=10: plot({f,F},x=-Pi..Pi,color=black);
5.2. Consider the function f (x) = 4 sin3 2x
a. Derive an identity relating sin3 θ in terms of sin θ and sin 3θ and express
f (x) in terms of simple sine functions.
b. Determine the Fourier coefficients of f (x) in a Fourier series expansion on
[0, 2π] without computing any integrals!
5.3. Find the Fourier series of f (x) = x on the given interval with the given
period T. Plot the N th partial sums and describe what you see.
a. 0 < x < 2, T = 2.
b. −2 < x < 2, T = 4.
5.4. The result in problem 5.1b above gives a Fourier series representation of
x2
4 . By picking the right value for x and a little arrangement of the series,
show that [See Example 5.8.]
a.
π2
1
1
1
= 1 + 2 + 2 + 2 + ···.
6
2
3
4
5.5 Appendix: The Gibbs Phenomenon
b.
183
π2
1
1
1
= 1 + 2 + 2 + 2 + ···.
8
3
5
7
5.5. Sketch (by hand) the graphs of each of the following functions over four
periods. Then sketch the extensions each of the functions as both an even and
odd periodic function. Determine the corresponding Fourier sine and cosine
series and verify the convergence to the desired function using Maple.
a. f (x) = x2 , 0 < x < 1.
b. f (x) = x(2 − x), 0 < x < 2.
0, 0 < x < 1,
c. f (x) =
1, 1 < x < 2.
π,
0 < x < π,
d. f (x) =
2π − x, π < x < 2π.