Engineering Mathematics (2)
Fourier Series and PDEs:
Review of Fourier Series
Chih-Chang Chang (張志彰)
ccchang0930@gs.ncku.edu.tw
Reference:
Dennis G. Zill, Advanced Engineering Mathematics (7th Edition), Jones & Bartlett Learning, 2022.
Outline
Orthogonal Functions (Review)
Fourier Series (Review)
Fourier Cosine and Sine Series (Review)
Jean-Baptiste Joseph Fourier
(1768-1830)
Complex Fourier Series & Fourier Transform (Review)
Fourier transform pair
=
F (ω ) F=
{ f ( t )}
∫
∞
−∞
f ( t )e − iωt dx
1 ∞
iωt
=
f ( t ) F=
F
ω
e
dω
{F (ω )}
)
(
∫
−∞
2π
−1
Reference:
Dennis G. Zill, Advanced Engineering Mathematics (7th Edition), Jones & Bartlett Learning, 2022.
Orthogonal Functions
Inner Product
• Recall: the inner product of two vectors: u and v
3
( u, v ) = u1v1 + u2v2 + u3v3 = ∑ uk vk
k =1
• Definition: Suppose f1 and f2 are piecewise continuous on an interval [a, b],
the inner product of two functions f1 and f2 on [a,b] is
b
( f1 , f 2 ) = ∫a f1 ( x ) f 2 ( x ) dx
Orthogonal Functions
• Recall: two vectors u and v are orthogonal whenever their inner product is zero
( u, v ) = 0
• Definition: f1 and f2 are orthogonal on an interval [a, b] if
=
( f1 , f 2 )
b
f ( x ) f ( x ) dx 0
∫=
a
1
2
Note: it has no geometric significant
Example:
f1 = x 2 and f 2 = x3 are orthogonal on [-1, 1]
Orthogonal Sets
• Definition: A set of real-valued functions {φ0 ( x ) , φ1 ( x ) , φ2 ( x ) ,...} is orthogonal
on an interval [a, b] if
b
, φn ) ∫ φm ( x ) φn ( x=
(φm=
) dx 0, m ≠ n
a
• Orthonormal sets:
square norm
2
φn=
( x)
(φ=
n , φn )
b
2
φ
∫ n ( x ) dx
a
n 1, 2,....
If {φn ( x )} is an orthogonal set of function on [a, b] and φn ( x=
) 1,=
{φ ( x )} is an orthonormal set on [a, b]
n
Vector Analogy
• Recall: u = c1v1 + c2 v 2 + c3 v 3 , where v1 , v 2 , v 3 are orthogonal nonzero vector
3
(u, v1 )
(u, v 2 )
(u, v 3 )
(u, v n )
u=
v +
v2 +
v3 = ∑
v
2 1
2
2
2 n
|| v1 ||
|| v 2 ||
|| v 3 ||
n =1 || v n ||
• Orthogonal series expansion: generalized Fourier series
∞
b
f ( x ) = ∑ cnφn ( x )
n =0
f ( x ) φ ( x ) dx
∫
where c =
n
f , φn )
(
f ( x) = ∑
φn ( x )
2
n =0 φ ( x )
n
∞
Notation:
a
n
φn ( x )
2
Orthogonal Set/Weight Function
• Definition: A set of real-valued functions {φ0 ( x ) , φ1 ( x ) , φ2 ( x ) ,...} is orthogonal
with respect to a weight function w(x) on [a, b] if
b
)dx 0, m ≠ n
∫ w( x)φ ( x)φ ( x=
m
a
n
• Orthogonal series expansion: generalized Fourier series
∞
f ( x ) = ∑ cnφn ( x )
n =0
b
f ( x) w( x)φ ( x) dx
∫
c =
n
a
n
|| φn ( x) ||2
where
b
|| φn ( x) || = ∫ w( x)φn2 ( x) dx
2
a
Orthogonal Sets
Exercise 12.1.12: Show that the given set of functions is orthogonal.
Find the norm of each function in the set
nπ
mπ
x, sin =
x , n 1,2,3...,
m 1,2,3...; [− p, p ]
=
1, cos
p
p
Fourier Series
Trigonometric Series
• The following set of trigonometric functions is orthogonal on [-p, p]:
π
2π
3π
π
2π
3π
x, cos
x, , sin x, sin
x, sin
x,
1, cos x, cos
p
p
p
p
p
p
• Certain BVPs involving linear PDEs, we will need to expand a function f(x) on [p, -p]
in an orthogonal series consisting of the trigonometric functions
a0 ∞
nπ
nπ
f ( x) = + ∑ an cos
x + bn sin
x
p
p
2 n=1
Find coefficients: a0, an, bn
Fourier Series
• Definition: The Fourier series of a function f(x) defined on [-p, p] is given by
a0 ∞
nπ
nπ
f ( x) = + ∑ an cos
x + bn sin
x
p
p
2 n=1
where
1 p
a0 = ∫ f ( x)dx
p −p
1 p
nπ
an = ∫ f ( x)cos
x dx
p −p
p
1 p
nπ
bn = ∫ f ( x)sin xdx
p −p
p
Expansion in a Fourier Series
−π < x < 0
0,
Example: f ( x ) =
0≤ x <π
π − x,
Sol:
π
1 − (−1) n
1
f ( x) =
+ ∑
cos nx + sin nx
2
4 n=1 n π
n
∞
Convergence of a Fourier Series
Conditions for convergence where f and f’ are piecewise continuous on [p, -p]
• The Fourier series of f converges to f(x) at a point of continuity
• At a point of discontinuity, the Fourier series converges to the average
f ( x +) + f ( x −)
2
−π < x < 0
0,
f ( x) =
0≤ x <π
π − x,
f (0+ ) + f (0−) π + 0 π
= =
2
2
2
Periodic Extension
f (x +T ) =
f ( x)
Even and Odd Functions
Even functions
Odd functions
f (−x) =
f ( x)
f (−x) =
− f ( x)
cos ( − x ) =
cos ( x )
sin ( − x ) =
− sin ( x )
Even and Odd Functions
Cosine and Sine Series
• Fourier series of an even function on [-p, p] is cosine series
a0 ∞
nπ
f ( x=
x
+ ∑ an cos
)
p
2 n =1
2 p
where a0 = ∫ f ( x ) dx and
p 0
2 p
nπ
an = ∫ f ( x ) cos
xdx
0
p
p
• Fourier series of an odd function on [-p, p] is sine series
nπ
f ( x ) = ∑ bn sin
x
p
n =1
∞
2 p
nπ
where bn = ∫ f ( x ) sin
xdx
0
p
p
Cosine and Sine Series
• Fourier series of an even function on [-p, p] is cosine series
a0 ∞
nπ
f ( x=
x
+ ∑ an cos
)
p
2 n =1
2 p
where a0 = ∫ f ( x ) dx and
p 0
2 p
nπ
an = ∫ f ( x ) cos
xdx
0
p
p
• Fourier series of an odd function on [-p, p] is sine series
nπ
f ( x ) = ∑ bn sin
x
p
n =1
∞
2 p
nπ
where bn = ∫ f ( x ) sin
xdx
0
p
p
Expansion in a Sine Series
Example:
Ans:
−1, −π < x < 0
f ( x) =
0≤ x <π
1,
2 ∞ 1 − (−1) n
f ( x) = ∑
sin nx
n
π n=1
Gibbs phenomenon
Half-Range Expansions
If we are interested in a function defined on (0, L) rather than (–p, p), we may
supply an arbitrary definition of f on (–L, 0) by either:
i.
Reflecting the graph of the function about the y-axis onto (–L, 0) so the
function is even on (–L, L)
ii.
Reflecting the graph of the function through the origin onto (–L, 0) so the
function is odd on (–L, L)
iii. Defining f on (–L, 0) by f(x)=f(x+L)
Half-Range Expansions
Example: Expand f(x) = x2, 0 < x < L, (a) in a cosine series, (b) in a sine series
(c) in a Fourier series.
(a) even reflection
L2 4 L2 ∞ (−1) n
nπ
f ( x=
+ 2 ∑ 2 cos
x
)
L
3 π n=1 n
(b) odd reflection
nπ
2 L2 ∞ (−1) n+1
2
n
f ( x) =
x
+ 3 2 [(−1) − 1] sin
∑
L
π n=1 n
nπ
(c) Identity reflection
L2 L2 ∞ 1
2nπ
1
2nπ
f ( x) =
x − sin
x
+ ∑ 2 cos
3 π n=1 n π
L
n
L
Complex Fourier Series
& Fourier Transform
Time Domain to Frequency Domain
• Complex Fourier Series: periodic
• Fourier transform (complex Fourier integral): aperiodic
Author: Lucas V. Barbosa
Bonus Points for Midterm #1 (Due 4/19)
Problem:
1,
( x) 0,
f=
1,
− 2 < x < −1
−1 < x < 1
1< x < 2
f(x)
-2
x
-1
1
2
(1) Expand the function of f(x) in an appropriate Fourier, cosine or sine series
(2) Use Python, or Matlab, or Excel…. to graph the partial sums {SN(x)} of
the series you obtained. Experiment with different values of N and
graphs them. Discuss the Gibbs phenomenon you observed. What is the
value of N for which a good approximation of f(x) can be obtained ?
(3) Find the frequency spectrum of f(x).
Complex Fourier Series
• In certain applications, for example, the analysis of periodic signals in
electrical engineering, it is more convenient to represent f in an infinite series
of complex-valued functions of a real variable x such as the exponential
functions: einx , n = 0,1, 2,....
• Recall: Euler’s formula
=
e
cos x + i sin x
ix
eix + e − ix
eix − e − ix
=
cos x =
, sin x
2
2i
gives =
e − ix cos x − i sin x
Complex Fourier Series
nπ x
cos
p
einπ x / p + e − inπ x / p
nπ x einπ x / p − e − inπ x / p
, sin
=
2
2i
p
a0 ∞
nπ
nπ
f ( x) = + ∑ an cos
x + bn sin
x
p
p
2 n=1
a0 ∞ einπ x /p + e − inπ x /p
einπ x /p + e − inπ x /p
f ( x) =
+ ∑ an
+ bn
2 n=1
2
2i
a0 ∞ 1
1
inπ x/p
= + ∑ (an − ibn )e
+ (an + ibn )e −inπ x/p
2 n=1 2
2
∞
= c0 + ∑ cne
n =1
inπ x/p
∞
+ ∑ c−ne −inπ x/p
n =1
cn , c− n are complex conjugates
Complex Fourier Series: coefficients
1 1 p
c0 = . ∫ f ( x) dx
2 p −p
nπ
nπ
1
1 1 p
1 p
cn =
x dx − i ∫ f ( x) sin
x dx
(an − ibn ) =
∫ − p f ( x) cos
p
p −p
p
2
2 p
1 p
= ∫ f ( x)e − inπ x / p dx
2 −p
1
1 1 p
nπ
1 p
nπ
c− n =
(an + ibn ) =
x dx + i ∫ f ( x) sin
x dx
∫ − p f ( x) cos
2
2 p
p
p −p
p
1 p
= ∫ f ( x)einπ x / p dx
2 −p
Complex Fourier Series
• Definition: The Complex Fourier Series of function f defined on an interval (−p, p)
is given by
∞
f ( x ) = ∑ cn e
inπ x / p
n = −∞
1 p
− inπ x / p
=
c
f
x
e
dx, n = 0, ± 1, ± 2,
(
)
where
n
∫
2p −p
• If f satisfies the hypotheses of the convergence theorem, a complex Fourier
series converges to f(x) at a point of continuity and to the average at a point of
discontinuity
f ( x + ) + f ( x −)
2
Fundamental Frequency
• The fundamental period is T = 2p and then p = T/2, the Fourier series becomes
a0 ∞
f ( x) =
+ ∑ (an cos nω x + bn sin nω x)
2 n=1
complex Fourier series
∞
f ( x ) = ∑ cn e
inω x
n =−∞
where ω = 2π/T is called the fundamental angular frequency
• If f is periodic and has fundamental period T, the plot of the points (nω, |cn|) is
called the frequency spectrum of f.
Complex Fourier Series
Example: Expand f(x) = e–x, −π < x <π, in a complex Fourier series.
1 π − x − inx
1 π − ( in+1) x
=
e e dx
e
dx
∫
∫
−
−
π
π
2π
2π
1
e − ( in+1)π − e( in+1)π
=
−
2π (in + 1)
Sol:
=
cn
Using Euler’s formula
e − ( in+1)π =
e −π (cos nπ − i sin nπ ) =
(−1) n e −π
e( in+1)π =
eπ (cos nπ + i sin nπ ) =
(−1) n eπ
Complex Fourier series
=
f ( x)
sinh π
π
1 − in inx
(−1) 2 e
∑
n +1
n =−∞
∞
n
cn = (−1) n
sinh π 1 − in
π n2 + 1
Frequency Spectrum
∞
f ( x) = ∑ cn e
inx
where
n =−∞
sinh π 1 − in
cn = (−1)
π n2 + 1
Frequency spectrum | cn | =
n
sinh π
1
π
n2 + 1
n
-3
-2
-1
0
1
2
3
| cn |
1.162
1.644
2.599
3.676
1.162
1.644
2.599
Frequency Spectrum
Example: Find the spectrum of the wave. The wave is the periodic extension of
the function f:
− 12 < x < − 14
0,
f ( x) = 1,
− 14 < x < 14
0,
1 < x< 1
4
2
Sol:
T=1=2p, p=1/2
=
cn
∫
12
−1 2
f ( x )e
2 inπ x 1/ 4
2 inπ x
=
dx
∫
14
−1 4
1 ⋅ e 2inπ x dx
e
1 einπ / 2 − e − inπ / 2
= =
2inπ −1/ 4 nπ
2i
nπ
1
cn =
sin
nπ
2
Fourier Series Fourier Transform
Complex Fourier series f ( x ) =
∞
inπ x / p
c
e
∑ n
n = −∞
Periodic Signal, f(x) , period 2p
1 p
− inπ x / p
(
)
cn =
f
x
e
dx
∫
−
p
2p
π
nπ
π
, p=
let ωn =
= n∆ω , ∆ω= ωn +1 − ωn=
∆ω
p
p
∆ω +π ∆ω
− in∆ωt
in∆ω x
f ( x ) = lim ∑
f
t
e
dt
e
(
)
∫
−π ∆ω
∆ω → 0
π
2
n = −∞
∞ 1
∞
iω x
− iωt
=∫
f
t
e
dt
e
dω
(
)
−∞ 2π ∫−∞
F (ω )
∞
-3p
Fourier transform pair
=
F (ω ) F=
{ f ( x )}
−1
f ( x ) F=
{F (ω )}
∫
∞
−∞
-p
p
-p
p
3p
f ( x )e − iω x dx
1
iω x
ω
F
e
dω
(
)
∫
−∞
2π
∞
−∞
f(x)
Aperiod Signal
+∞
Complex Fourier Series vs Fourier Transform
Complex Fourier
Series
Time Frequency
Frequency Time
1 p
− inωt
(
)
cn =
f
t
e
dt
∫
2p −p
∞
f ( t ) = ∑ cn einωt
Continuous, Periodic
Discrete, Aperiodic
Fourier Transform
Fourier Transform
∞
F (ω ) = ∫ f (t )e
−∞
n = −∞
Inverse Fourier Transform
− iωt
dt
Continuous, Aperiodic
1 ∞
iωt
f (t ) =
F
ω
e
dω
(
)
∫
2π −∞
Continuous, Aperiodic