Math 201 Lecture 30: Fourier Cosine and Sine Series

Math 201 Lecture 30: Fourier Cosine and Sine Series
Mar. 23, 2012
•
Many examples here are taken from the textbook. The first number in () refers to the problem number
in the UA Custom edition, the second number in () refers to the problem number in the 8th edition.
0. Fourier Series and Pointwise Convergence
•
Fourier Series Expansion: Given f (x) defined for −L < x < L, its Fourier series reads
∞ h
i
nπx
a0 X
nπx
ancos
f (x) ∼ +
+ bn sin
,
L
2
L
with
an =
•
1
L
Z
L
f (x) cos
−L
nπx
dx;
L
bn =
1
L
Z
L
f (x) sin
−L
nπx
dx.
L
(2)
Pointwise Convergence: First extend f periodically (that is into a periodic function with period 2 L).
Then
If f is continuous at x0, then
◦
∞
a0 X
+
2
n=1
n
an cos
o
n π x0
n π x0
+ bn sin
= f (x0)
L
L
(3)
If f has a jump (from fleft to fright) at x0, then
◦
∞
a0 X
+
2
n=1
•
(1)
n=1
n
an cos
o
1
n π x0
n π x0
= [fleft + fright].
+ bn sin
2
L
L
(4)
Some pitfalls in computing Fourier series.
Example 1. Find the Fourier series representation of the function
f (x) = cos2x,
(5)
− π < x < π.
The following is a wrong solution.
Wrong Solution from 201 Exams of Earlier Years. L = π
f (x) ∼
a0 =
1
π
Z
π
cos2x dx =
−π
2
π
Z
a0
+
2
∞
X
nπx
L
= n x.
[an cos (n x) + bn sin (n x)].
(6)
n=1
π
cos2 x dx =
0
2
π
Z
π
0
1 + cos (2 x)
2
dx =
1
π
Z
π
dx +
0
1.
1
π
Z
π
cos (2 x) dx =
0
(7)
an =
=
=
=
=
=
Z
π
1
cos2 x cos (n x) dx
π −π
Z
2 π 1 + cos (2 x)
cos (n x) dx
π Z0
2
Z
1 π
1 π
cos (n x) dx +
cos (2 x) cos (n x) dx
π 0
Zπ π 0
1 1
1
sin (n x)N π0 +
[cos (2 − n) x + cos (2 + n) x] dx
π2 0
nπ Z
Z π
π
1
1
cos (2 − n) x dx +
cos (2 + n) x dx
2π 0
2π 0
1
1
sin (2 − n) xN π0 +
sin (2 + n) xN π0 =0.
2 π (2 − n)
2 π (2 + n)
1
(8)
Math 201 Lecture 30: Fourier Cosine and Sine Series
2
bn = 0 for all n because cos2x is an even function. So
1
cos2x ∼ .
2
(9)
Remark 2.
1. Using pointwise convergence to show that the answer is definitely wrong. (Periodic extension
of cos2x is continuous everywhere so its Fourier series should converge to cos2x for all x, so 1/2
is definitely wrong)
2. Spot the mistake in the calculation. (Division by 2 − n – The calculation for an is wrong for
an = 2.)
1
1
3. Is there anyway to obtain this particular Fourier expansion superfast? (cos2 = 2 + 2 cos (2 x) is
P
a
already of the form 20 + ∞
n=1 [an cos (n x) + bn sin (n x)] so it has to be the Fourier expansion).
1. Fourier, Fourier Cosine, Fourier Sine
•
Recall
◦
Fourier series:
−
Related to the eigenvalue problem
X ′′ − K X = 0;
−
X(−L) = X(L); X ′(−L) = X ′(L);
Base functions:
nπx
nπx
, sin
,
n = 1, 2, 3, cos
L
L
Expansion formulas:
∞ h
i
X
a
nπx
nπx
ancos
f (x) ∼ 0 +
+ bn sin
,
2
L
L
n=1
with
Z
Z
1 L
nπx
nπx
1 L
dx;
bn =
dx.
f (x) cos
f (x) sin
an =
L −L
L
L
L −L
1,
−
◦
(11)
(12)
(13)
Fourier Cosine series:
−
Related to the eigenvalue problem
X ′′ − K X = 0;
−
Base functions:
1,
−
Expansion formulas:
2
an =
L
Fourier Sine series:
(15)
(16)
Z
L
f (x) cos
0
nπx
dx.
L
(17)
Related to the eigenvalue problem
Base functions:
sin
−
n = 1, 2, 3, ∞
a0 X
nπx
,
+
ancos
2
L
X ′′ − K X = 0;
−
(14)
n=1
with
−
X ′(0) = X ′(L) = 0.
nπx
cos
,
L
f (x) ∼
◦
(10)
Expansion formulas:
nπx
,
L
f (x) ∼
∞
X
n=1
X(0) = X(L) = 0.
n = 1, 2, 3, nπx
;
bnsin
L
(18)
(19)
(20)
Mar. 23, 2012
with
2
bn =
L
Z
L
f (x) sin
0
3
nπx
dx.
L
(21)
Clearly there should be some connections.
•
In this lecture we will:
1. Clarify this connection;
2. Discuss pointwise convergence of Fourier Cosine and Sine series.
2. Basic Information
•
Fourier Cosine and Fourier Sine as special cases of Fourier.
◦
Odd and even extensions.
Consider a function f (x) defined on 0 < x < L. Let’s define its “odd extension” and “even
extension” as
f (x)
0<x<L
f (x) 0 < x < L
fo(x) =
;
fe(x) =
.
(22)
−f (−x) −L < x < 0
f (−x) −L < x < 0
Note that fo and fe are functions defined on −L < x < L.
◦
Fourier series of fo and fe.
Let’s compute the Fourier series for fo and fe.
−
Fourier series for fo:
fo(x) ∼
∞ h
i
nπx
nπx
a0 X
+
ancos
+ bn sin
,
L
L
2
(23)
n=1
with
an
Z
nπx
1 L
fo(x) cos
=
dx
L
L −L
Z L
Z
1 0
nπx
nπx
1
dx +
dx
fo(x) cos
fo(x) cos
=
L −L
L
L
L 0
Z
Z
1 0
1 L
nπx
nπx
dx −
dx.
=
f (x) cos
f (−x) cos
L −L
L 0
L
L
(24)
Now to evaluate the 2nd integral, we do a change of variable:
t = −x
dx = −dt
which leads to
Z
Z
nπx
1 0
n π (−t)
1 0
f (−x) cos
f (t) cos
dx =
(−dt)
L
L −L
L
L L
Z 0
nπt
1
dt
f (t) cos
= −
L
L L
Z L
1
nπt
=
dt.
f (t) cos
L 0
L
Thus
Z
Z
1 L
1 L
nπx
nπt
dx −
dt = 0.
an =
f (x) cos
f (t) cos
L 0
L 0
L
L
Similarly we can compute
Z
1 L
nπx
bn =
fo(x) sin
dx
L −L
L
Z L
Z
1 0
nπx
nπx
1
dx −
dx
f (x) sin
f (−x) sin
=
L −L
L
L
L 0
Z L
nπx
2
f (x) sin
=
dx.
L
L 0
(25)
(26)
(27)
(28)
Math 201 Lecture 30: Fourier Cosine and Sine Series
4
Summarizing, we see that the Fourier series for fo is
Z
∞
X
2 L
nπx
nπx
bnsin
with
bn =
dx.
f (x) sin
L 0
L
L
(29)
n=1
This is exactly the Fourier Sine series for f .
Theorem 3. Let f (x) be defined on 0 < x < L. Let fo(x) be its odd extension to
−L < x < L. Then the Fourier sine series for f (x) is the same as the Fourier series for
fo(x) (in the sense that they look exactly the same).
−
Fourier series for fe:
fe(x) ∼
∞ h
i
a0 X
nπx
nπx
+
ancos
+ bn sin
,
2
L
L
(30)
n=1
We have
an =
=
=
=
Z
nπx
1 L
fe(x) cos
dx
L
L −L
Z L
Z
1 0
nπx
nπx
1
dx +
dx
fe(x) cos
fe(x) cos
L −L
L
L
L 0
Z
Z
1 0
nπx
nπx
1 L
dx +
dx
f (x) cos
f (−x) cos
L −L
L
L
L 0
Z L
nπx
2
f (x) cos
dx.
L
L 0
(31)
and similar calculation gives
It follows that
1
bn =
L
Z
L
fe(x) sin
−L
nπx
dx = 0.
L
(32)
Theorem 4. Let f (x) be defined on 0 < x < L. Let fe(x) be its even extension to
−L < x < L. Then the Fourier cosine series for f (x) is the same as the Fourier series
for fo(x) (in the sense that they look exactly the same).
•
Pointwise convergence for Fourier Cosine and Fourier Sine.
◦
Fourier Cosine series.
Given f (x) defined for 0 < x < L, to obtain the function that is the pointwise sum of the
Fourier Cosine series of f ,
1. Do an even extension of f to fe;
2. Obtain the sum of the Fourier cosine series using the pointwise convergence result for
the Fourier sereis for fe (Extend fe periodically. ...).
◦
Fourier Sine series.
Given f (x) defined for 0 < x < L, to obtain the function that is the pointwise sum of the
Fourier Sine series of f ,
1. Do an odd extension of f to fo;
2. Obtain the sum of the Fourier cosine series using the pointwise convergence result for
the Fourier sereis for fo (Extend fo periodically, ...).
3. Examples
Example 5. Consider the function
f (x) =
a) Plot the function.
1−x 0<x61
.
1
1<x62
(33)
Mar. 23, 2012
5
b) Plot its odd-periodic and even-periodic extensions over (−6, 6).
c) Compute its Fourier Cosine and Sine expansions.
d) Plot the functions to which the Fourier Cosine and Fourier Sine expansions converge to.
Solution.
a)
1
2
1
0
1−x
Note that the function is only defined for 0 < x 6 2 so it is not defined outside.
b)
Odd-Periodic
0
Even-Periodic
0
c) As f (x) is defined for 0 < x 6 2, we see that L = 2.
•
Fourier Cosine:
an =
Recalling
2
L
Z
L
0
we have
an =
Z 2
nπx
nπx
dx =
f (x) cos
dx.
2
L
0
1−x 0<x61
.
f (x) =
1
1<x62
Z 2
nπx
nπx
(1 − x) cos
dx +
cos
dx.
2
2
1
f (x) cos
Z
0
1
First compute a0:
a0 =
Z
1
(1 − x) dx +
0
Z
1
2
3
dx = .
2
(34)
(35)
(36)
(37)
Math 201 Lecture 30: Fourier Cosine and Sine Series
6
Next
1
Z 2
nπx
nπx
(1 − x) cos
dx +
cos
dx
2
2
0 Z
1
h i
1
nπx
2
2
nπx 2
=
(1 − x) d sin
+
sin
N1
2
nπ 0
nπ
2
Z
h
i
1
2
nπx 1
nπ
2
nπx
(1 − x) sin
d(1 − x) +
sin (n π) − sin
N
sin
=
0−
nπ
2
2
nπ
2
0
Z 1
nπx
2
2
nπ
=
0−0+
sin
dx −
sin
2
nπ
n
π
2
0 4
nπx 1 2
nπ
= − 2 2 cos
N 0 − n π sin 2
n π h
2 i
4
nπ
nπ
2
= − 2 2 cos
sin
−1 −
n π
2 2 nπ
nπ
nπ
4
4
2
sin
= 2 2 − 2 2 cos
−
.
(38)
2
2
n π
n π
nπ
Now since


 0 n odd
 0 n even
nπ
nπ
= 1 n=4k
= 1 n=4k+1
,
sin
(39)
cos


2
2
−1 n = 4 k + 2
−1 n = 4 k + 3
we have


0
n=4k




4
2

 2 2−
n=4k+1

n π
nπ
.
(40)
an =
8

n=4k+2

2
2

n π



2
4

 2 2+
n=4k+3
nπ
n π
an =
Z
The Fourier cosine series is
f (x) ∼
with an given as above.
•
∞
nπx
a0 X
+
an cos
2
2
(41)
n=1
Fourier Sine: We have
Z 2
Z
2 L
nπx
nπx
bn =
dx =
f (x) sin
dx
f (x) sin
L 0
2
L
Z0 1
Z 2
nπx
nπx
=
(1 − x) sin
dx +
sin
dx
2
2
0
1
Z 1
i
h
2
2
nπx
nπx 2
−
= −
(1 − x) d cos
cos
N1
nπ
nπ 0
2
2
Z 1
nπx 1
2
nπx
(1 − x) cos
d(1
−
x)
N
−
cos
= −
0
2
nπ
2
h
i 0
2
nπ
−
cos (n π) − cos
nπ
2
Z 1
2
nπx
= −
0−1+
cos
dx
nπ
2
0
h
i
2
nπ
−
cos (n π) − cos
nπ
2
2
nπx 1
2
−1 +
sin
N0
= −
nπ
2
nπ
h
i
nπ
2
cos (n π) − cos
−
nπ
2 h
i
2
4
2
nπ
nπ
=
− 2 2 sin
−
cos (n π) − cos
. (42)
nπ n π
nπ
2
2
Mar. 23, 2012
7
Now again using

 0 n odd
nπ
cos
= 1 n=4k
,

2
−1 n = 4 k + 2

 0 n even
nπ
= 1 n=4k+1
sin

2
−1 n = 4 k + 3
together with
cos (n π) = (−1)n ,
(43)
(44)
we have
The Fourier sine series is

2




n
π




 4 − 4
2 2
bn = n π n π
2


−


nπ



4
4


+
n π n2 π 2
f (x) ∼
∞
X
n=4k
n=4k+1
.
n=4k+3
bn sin
n=1
nπx
2
with bn given by the above formulas.
d) The functions the Fourier cosine and Fourier sine series converge to: in red:
Fourier sine:
0
Fourier cosine:
0
(45)
n=4k+2
(46)