Fourier Series: Concepts and Calculations
Fourier Series: Concepts and Calculations
Complex functions. f (x) is called a complex function, if we can write it in the form
where f1 (x) and f2 (x) are two real functions. The conjugate of f (x) is the complex
function f (x) = f1 (x) ° i f2 (x). We shall often use the relations
Definition 4.1 (Orthogonal functions). Two complex functions f (x) and g(x) are
said to be orthogonal on the interval [a, b] if the following holds
Z b
(f, g) := f (x)g(x)dx = 0
a
where g(x) is the conjugate of g(x). For example, {eikx }1 k=1 is an orthogonal sequence
of functions on [°º, º] or [0, 2º], since
Z 2º
ikx ilx
(e , e ) = eikx eilx dx = 0 8 l 6= k
0
In fact, Z Z
2º 2º
1 Ø2º
Ø
eikx eilx dx = eikx e°ilx dx = ei(k°l)x Ø = 0 .
0 0 i(k ° l) 0
{cos kx}1
k=0 , {sin kx}1
k=0 , {cos kx, sin kx}1
k=0
40
Definition 4.2 (Periodic functions). A function f (x) is called a periodic function
with period d if
f (x + d) = f (x) 8 x .
For example, eikx , cos kx and sin kx are all periodic functions with period 2º. But
Now, let us discuss the Fourier series. The idea of the Fourier series is to expand
a given function f (x) (maybe discontinuous) in terms of the cosine and sine functions.
We will consider the following two types of expansions:
1
X
f (x) = ck eikx = c0 + c°1 e°ix + c1 eix + c°2 e°2ix + c2 e2ix + · · · (4.1)
k=°1
f (x) = a0 + a1 cos x + b1 sin x + a2 cos 2x + b2 sin 2x + · · · (4.2)
Note that the right hand sides of (4.1) and (4.2) are all functions with period of 2º. So
function f (x) must be also a function with period 2º. Because of the periodicity, we can
consider any interval of length 2º for the Fourier expansions (4.1) and (4.2). We often
take [°º, º] or [0, 2º]. In our subsequent discussions, we will always use the interval
[°º, º].
Now suppose f (x) is a function with period 2º, i.e., f (x + 2º) = f (x) 8x . In this
case, the graph of f (x) in any interval of length 2º will be repeated in its neighboring
interval of length 2º.
41
Find the coe±cient ak in (4.2). Multiply both sides of (4.2) by cos kx, integrate
then over [°º, º] and use the orthogonality (4.3)-(4.5). We have
Z º Z º
f (x) cos kxdx = ak cos kx cos kxdx.
°º °º
Find the coe±cient a0 in (4.2). Multiply both sides of (4.2) by the constant 1, then
integrate over [°º, º] to obtain
Z º Z º
f (x)dx = a0 dx,
°º °º
therefore, Z º
1
a0 = f (x)dx , (4.8)
2º °º
that is, the first coe±cient a0 is the average of f (x) on [°º, º].
In summary, we can expand f (x) as follows:
42
Complex Fourier series
Now we shall discuss how to find the complex Fourier series (4.1), namely,
1
X
f (x) = ck eikx . (4.9)
k=°1
We need to find all the coe±cients {ck }. By Definition 3.1, we know that {eikx } are
orthogonal on [°º, º], namely for any k 6= l,
Z º
ikx ilx
(e , e ) = eikx e°ilx dx = 0 8 k 6= l.
°º
Thus multiply both sides of (4.9) by e°ikx and use the orthogonality of {eikx }, we obtain
Z º Z º
°ikx
f (x)e dx = ck eikx e°ikx dx ,
°º °º
or Z º
1
ck = f (x)e°ikx dx . (4.10)
2º °º
Remark 4.1. Note that in the Fourier series (4.11), the function f (x) can be a real
function. For a real function, one can choose the real Fourier expansion (4.2) or the
complex form (4.11).
Think about why we can choose the complex form (4.11) for a real function. Any
contradiction ?
(a) The coe±cients ck in the complex form (4.11) can be derived from the coe±cients
ak and bk in the real form (4.2). In fact, we know
43
Multiply both sides of the second equation by f (x) and integrate over [°º, º]. We
obtain Z º Z º Z º
°ikx
f (x)e dx = f (x) cos kxdx ° i f (x) sin kxdx ,
°º °º °º
That implies
2ck = ak ° i bk . (4.13)
This can be written as
1 i
ck = ak ° bk .
2 2
Similarly, we can derive from the first equation of (4.12):
1 i
c°k = ak + bk .
2 2
(b) The real coe±cients ak and bk in (4.2) can be recovered from the complex coe±-
cients ck in (4.11). Using the formula
1 ° ikx ¢ 1 ° ikx ¢
cos kx = e + e°ikx , sin kx = e ° e°ikx .
2 2i
Therefore
Z
1 º
ak = f (x) cos kxdx = ck + c°k ,
º °º
Z
1 º 1
bk = f (x) sin kxdx = (c°k ° ck ).
º °º i
44
Therefore the Fourier series of f (x) is
1 1
f (x) = + cos 2x .
2 2
This is a well-known formula. ]
• Try the Fourier expansions of the functions sin2 x, cos 2x, sin x + cos x, · · · .
Example 4.2. Find the Fourier series of f (x) = ±(x) on [°º, º]. This function is
called a delta function and it is one of the most important functions used in physics and
engineering. The delta function has the following properties
Z º
g(x)±(x)dx = g(0) 8 g 2 C [°º, º]
°º
and
±(x) = 0 for any x 6= 0.
45
this is the same as (4.14).
Can the series (4.15) really reflect the behavior of ±(x) ?
Let us consider the partial sum of (4.15):
N
X N
ikx 1 °iN x X i(N +k)x
PN (x) = e = e e
k=°N
2º k=°N
2N
X
°iN x
=e eikx
k=0
1 ° ei(2N +1)x
= e°iN x
1 ° eix
1 1
ei(N + 2 )x ° e°i(N + 2 )x
=
eix/2 ° e°ix/2
sin(N + 12 )x
= .
sin 12 x
Then study the following questions
2. Plot the figure for PN (x) using Matlab; and calculate the integral
Z º
1
PN (x)f (x)dx
2º °º
approximately for N = 10, 20, 30, 40, 50, 100. Observe if PN (x) satisfies that
Z º
1
lim PN (x)f (x)dx = f (0).
N !1 2º °º
1
if so, P (x)
2º N
approximates ±(x).
Odd and even functions. A function f (x) is called an even function if it satisfies
46
For any odd function f (x) on [°º, º], we have
Z º
f (x)dx = 0 .
°º
f (x) = x , x 2 [°º, º] .
47
4.4 Sine series and cosine series
Every function f (x) can be written as a sum of an even and an odd function, i.e.,
with
f (x) + f (°x) f (x) ° f (°x)
fe (x) = , fo (x) = .
2 2
The Fourier series of an even function has only cosine terms, since
Z
1 º
bk = f (x) sin kxdx = 0 .
º °º
The Fourier series of an odd function has only sine terms, since
Z
1 º
ak = f (x) cos kxdx = 0 .
º °º
Example 4.4. The function f (x) = 1 is known on the half-period 0 < x < º. Find its
Fourier series when
48
(b) f (x) is an odd function,
Z º
1
a0 = f (x)dx = 0 ,
2º °º
Z
1 º
ak = f (x) cos kxdx = 0 ,
º °º
Z Z
1 º 2 º
bk = f (x) sin kxdx = sin kxdx
º °º º 0
8
2 ° ¢ <0, k is even
k
=° (°1) ° 1 =
kº : 4 , k is odd ,
kº
49
therefore Z º
1
Ak = f (x) cos kxdx = ak ,
º °º
6 0. Similarly we have
for k =
Z º
1
A0 = f (x)dx = a0 ,
2º °º
and Z º
1
Bk = f (x) sin kxdx = bk , 8k .
º °º
This indicates that the minimizer {Ak , Bk }nk=0 is the Fourier coe±cients of f (x). ]
• Think about why we can claim what we get is the minimizer, not the maximizer.
Think about the diÆerence between E({Ai }, {Bi }) and E({ai }, {bi }).
then we have Z º Z º
Fn2 (x)dx ∑ f 2 (x)dx .
°º °º
thus
Z º Z º
2
° ¢2
f (x)dx = f (x) ° Fn (x) + Fn (x) dx
°º
Z°º
º ° Z º Z º
¢2 ° ¢
= f (x) ° Fn (x) dx + 2 f (x) ° Fn (x) Fn (x)dx + Fn2 (x)dx
Z°º
º ° Z º°º °º
¢2
= f (x) ° Fn (x) dx + Fn2 (x)dx
Z°º
º
°º
∏ Fn2 (x)dx .
°º
50
]
51
4.6 Solution of the Laplace’s equation
In this section, we are going to apply the Fourier series to solve an important diÆerential
equation, i.e., the Laplace’s equation:
@ 2u @ 2u
+ = 0, (x, y) 2 ≠ (4.16)
@x2 @y 2
with the boundary condition
x = r cos µ , y = r sin µ .
Further, the domain ≠ and the equation (4.16) are transformed into
and
1 @ ° @u ¢ 1 @ 2 u
r + 2 2 =0. (4.18)
r @r @r r @µ
The boundary condition (4.17) changes into
We are now going to find the solutions of (4.18). First, we can easily check that the
following functions
1, r cos µ, r sin µ, r2 cos 2µ, r2 sin 2µ, · · · (4.20)
are all solutions of (4.18). For example, we take w(r, µ) = rk cos kµ for k ∏ 2, then
wr = krk°1 cos kµ ,
1 @
(rwr ) = k 2 rk°2 cos kµ ,
r @r
52
while
1
2
wµµ = °k 2 rk°2 cos kµ ,
r
k
therefore w(r, µ) = r cos kµ is a solution to the equation (4.18). Note that (4.18) is
a linear equation, so any combination of two solutions w1 (r, µ) and w2 (r, µ) is still a
solution (why ?). Thus the following combination of the above special solutions is a
genernal solution:
We know that w(1, µ) = u0 (cos µ, sin µ), so the coe±cients ak and bk are nothing else but
the Fourier coe±cients of u0 , i.e.,
Z º
1
a0 = u0 (cos µ, sin µ)dµ , (4.22)
2º °º
Z
1 º
ak = u0 (cos µ, sin µ) cos kµdµ , k = 1, 2, · · · (4.23)
º °º
Z
1 º
bk = u0 (cos µ, sin µ) sin kµdµ , k = 1, 2, · · · . (4.24)
º °º
This indicates that w(r, µ) in (4.21) is the desired solution of the boundary value problem
(4.18) with the coe±cients ak and bk given by (4.22)-(4.24).
and ( ° @u ¢ 1 @ 2 u
1 @
r @r
r @r + r2 @µ2 = 0, 0 ∑ r < 1, °º ∑ µ < º
u(1, µ) = ±(µ), °º ∑ µ < º .
53
4.7 Orthogonal functions
In this section, we introduce some further knowledge on orthogonal functions.
For a given positive function w(x) on [a, b], we define an inner product
Z b
(f, g)! = !(x) f (x) g(x)dx
a
for any two real functions f (x) and g(x) on [a, b]. And !(x) will be called a weight
function. We will often use the following norm:
nZ b o 12
kf k! = !(x) f 2 (x) dx .
a
Definition 4.3 (Weighted orthogonal functions). Let f (x) and g(x) be two real
functions on [a, b]. f (x) is said to be orthogonal to g(x) with respect to the inner product
(·, ·)! if (f, g)! = 0.
A sequence of functions {fk }1 k=0 is said to be orthonormal with respect to the inner
product (·, ·)! if the following holds:
(fm , fn )! = 0 8 m 6= n
• Check if function cos x is orthogonal to g(x) = sin x with respect to the inner product
(·, ·)! for !(x) = 1, x, x2 .
• Verify that any sequence of orthogonal functions {gk }1
k=1 on the interval [a, b] are
linearly independent.
54
Gram-Schmidt orthogonalization process.
Given a sequence {¡k }1k=0 of linearly independent functions defined on [a, b], we are
going to construct a sequence of orthonormal functions {qk }1
k=0 as follows:
0) Set
qe0 (x) = ¡0 (x) .
Normalize qe0 (x):
qe0 (x)
q0 (x) = ;
keq0 k !
1) Set
qe1 (x) = ¡1 (x) ° Æ10 q0 (x) ,
choose Æ10 such that
Z b
(e
q1 , q0 )! = !(x) q̃1 (x)q0 (x)dx = 0,
a
that gives, Z b
Æ10 = (¡1 , q0 )! = !(x) ¡1 (x)q0 (x)dx.
a
Normalize qe1 (x):
qe1 (x)
q1 (x) = .
keq1 k !
k) Suppose q0 , q1 , · · · , qk are constructed such that
with
Æk+1,i = (¡k+1 , qi )! , i = 0, 1, · · · , k.
Normalize qk+1 :
qek+1 (x)
qk+1 (x) = .
keqk+1 k!
(qi , qj )! = 0 8 i 6= j ; kqi k! = 1 .
55
Example 4.6. Given the sequence of polynomials
1, x, x2 , · · · , xk , · · · ,
on the interval [°1, 1], use the Gram-Schmidt orthogonalization process to construct an
orthonormal sequence of polynomials, and write down the first three constructed polyno-
mials explicitly.
Example 4.8. Based on a given sequence of functions {¡i (x)}1 k=0 , which is orthogo-
nal with respect to the inner product (·, ·)! , use the Gram-Schmidt orthogonalization to
construct an orthonormal sequence of functions with respect to (·, ·)! . (exercise)
Example 4.9. Expand a given function f (x) on [a, b] in terms of a given orthogonal
sequence of functions {¡k (x)}1
k=1 with respect to the inner product (·, ·)! .
Solution. Let
f (x) = Æ1 ¡1 (x) + Æ2 ¡2 (x) + Æ3 ¡3 (x) + · · · .
Think about how to find the coe±cients {Æk }. ]
56
4.8 Fourier transform
Fourier transforms play a very important role in mathematics, physics and engineering.
Recall that
eikx = cos(kx) + i sin(kx).
From this expression, we can easily see that the magnitude of k determines the intensity
of the oscillation of function exp(ikx), and k measures the frequencies of the oscillation.
To better understand the relation between the magnitude of k and the oscillation of
exp(ikx), , one may plot and compare the figures of sin ºx, sin 4ºx and sin 8ºx.
Definition 4.4. For a given function f (x) defined on (°1, 1), the Fourier transform
of f is a function fb depending on frequency:
Z 1
b
f (k) = f (x)e°ikx dx , °1 < k < 1 . (4.25)
°1
The inverse Fourier transform of fb(k) recovers the original function f (x):
Z 1
1
f (x) = fb(k)eikx dk , °1 < x < 1 . (4.26)
2º °1
Example 4.10. Find Fourier transform of the delta function f (x) = ±(x).
Solution.
Z 1 Z 1
fb(k) = °ikx
f (x)e dx = ±(x)e°ikx dx = 1, for all frequencies k .
°1 °1
Solution. Z Z
1 a
2 sin ka
fb(k) = f (x)e °ikx
dx = e°ikx dx = .
°1 °a k
• Think about whether this function fb(k) makes sense at k = 0.
57
Example 4.12. For a > 0, find the Fourier transform of the function:
8
< e°ax , x∏0
f (x) =
:°eax , x<0.
Solution. We have
Z 1 Z 1 Z 0
fb(k) = °ikx
f (x)e dx = e °ikx
dx + °e°ikx dx.
°1 0 °1
Ø1
But what is e°ikx Ø0 ? It is di±cult to know.
To solve this problem, we consider the function
8
< e°ax , x>0
fa (x) = ,
: ° eax , x<0
58
Example 4.14. Find the Fourier transformation of the constant function
f (x) = 1, 8 x 2 (°1, 1) .
Solution. We have
Z 1 Z 1 Z 0
fb(k) = e °ikx
dx =
dx + °ikx
e°ikx dx
e
°1 0 °1
Z Z 0
© 1 °ax °ikx ™
= lim+ e e dx + eax e°ikx dx
a!0 0 °1
8
© 1 1 ™ <0 k 6= 0
= lim+ + =
a!0 a + ik a ° ik :? k=0
What is fb(0) ? Note that fb(k) looks like a delta function. Let fb(k) = Ʊ(k), then by
the inverse Fourier transform we have
Z 1
1 Æ
1 = f (x) = fb(k)eikx dk = ,
2º °1 2º
so
Æ = 2º
or
fb(k) = 2º±(k), °1 < k < 1 .
(1) For a function f (x) on (°1, 1) and its Fourier transform fb(k), we have
Z 1 Z 1
2º 2
|f (x)| dx = |fb(k)|2 dk . (4.27)
°1 °1
59
Example 4.15. Check the relation (4.27) for the following function
8
<e°ax , x>0
f (x) =
:0 , x<0.
Solution. We have
Z 1 Z 1
º
2º 2
|f (x)| dx = 2º e°2ax dx = ,
°1 0 a
while Z 1 Z 1
fb(k) = f (x)e °ikx
dx = e°ax e°ikx dx
°1 0
1 Ø1 1
=° e°ax°ikx Ø0 = ,
a + ik a + ik
therefore Z Z 1 Z 1
1 Ø Ø dk dk º
Øfb(k)Ø2 dx = = = ,
|a + ik|2 2 2
°1 °1 °1 a + k a
that verifies (4.27). Here we have used the transformation k = a cos µ/ sin µ. ]
(1) One can directly verify from definition that for any complex number Æ,
c (k) = Æfb(k).
Æf
f[
+ g(k) = fb(k) + gb(k).
b
df
(k) = ik fb(k) .
dx
To see this, we use Z 1
1
f (x) = fb(k)eikx dk
2º °1
60
to obtain Z 1
df 1
(x) = ik fb(k)eikx dk.
dx 2º °1
gives
b
df
(k) = ik fb(k).
dx
Rx fb(k)
(4) The transform of F (x) = a
f (x)dx is ik
+ C ±(k), i.e.,
fb(k)
Fb(k) = + C ±(k)
ik
To see this, we use
dF (x)
= f (x),
dx
or
d° ¢
F (x) + C = f (x) 8C 2 R1 .
dx
Taking the transform on both sides,
° ¢
ik Fb(k) + 2C º±(k) = fb(k) ,
this is ,
fb(k)
Fb(k) = + C±(k) 8 C 2 R1 .
ik
=e °ikd
fb(k) .
61
(6) The transform of g(x) = eixd f (x) is fb(k ° d).
By definition, we have
Z 1 Z 1
°ikx
gb(k) = g(x)e dx = f (x)e(id°ik)x dx
Z°1
1
°1
0
= f (x)e°ik x dx = fb(k 0 ) = fb(k ° d) .
°1
we often write
u(x) = (G § h)(x)
or ≥ ¥ Z 1
u(x) = G § h (x) = G(x ° y)h(y)dy .
°1
Fourier transforms can be applied to solve diÆerent types of diÆerential equations. Here
we consider one example.
Consider the diÆerential equation
d2 u
° + a2 u = h(x) , °1 < x < 1 . (4.28)
dx2
62
In order to solve the equation, we apply the Fourier transform
Z 1
b(k) =
u u(x)e°ikx dx
°1
to each term of the equation to obtain
°(ik)2 u b(k) = b
b(k) + a2 u h(k) .
This gives
b
h(k)
b(k) =
u . (4.29)
a + k2
2
63