Let f(x)

Sine and Cosine Series - (12.3)
1. Sine and Cosine Series Expansions:
Let fŸx be an even function on "p, p . fŸx can be expanded to an even periodic function with period
2p :
f 1 Ÿx fŸx for x in "p, p with period T 2p.
Then the Fourier series of f 1 Ÿx .
f 1 Ÿx a 0 ! a n cosŸ n=x
p where
2
n1
a 0 2p
p
; 0 fŸx dx,
a n 2p
p
; 0 fŸx cosŸ n=x
p dx
is called the cosine series expansion of fŸx or fŸx is said to be expanded in a cosine series. Similarly, let
fŸx be an odd function on "p, p . fŸx can be expanded to an odd periodic function with period 2p :
f 2 Ÿx fŸx for x in "p, p with period T 2p.
Then the Fourier series of f 2 Ÿx .
! b n sinŸ n=x
p f 2 Ÿx where b n 2p
n1
p
; 0 fŸx sinŸ n=x
p dx
is called the sine series expansion of fŸx or fŸx is said to be expanded in a sine series.
Example Let fŸx x, " 1 x 1. Find the cosine or sine series expansion of fŸx .
Since fŸx is an odd function, it has a sine series expansion.
1
n= " 2 Ÿ"1 n 2 Ÿ"1 n1
b n 2 ; x sinŸn=x dx "2 n= cos
n=
n=
n2=2
0
.
f exp Ÿx ! b n sinŸn=x n1
.
!
n1
n1
2
n= Ÿ"1 sinŸn=x 2 sinŸ=x " 1 sinŸ2=x 1 sinŸ3=x " 1 sinŸ4=x . . .
=
4
2
3
1
0.8
0.6
0.4
0.2
-3
-2
-1
0
-0.2
1
x
2
3
-0.4
-0.6
-0.8
-1
fŸx x, " 1 t x t 1
1
Example Let fŸx cosŸx , " = t x t = . Find the cosine or sine series expansion of fŸx .
2
2
Since cos x is even on " = t x t = , it has a cosine series expansion.
2
2
4 ; =/2 cosŸx dx 4
a0 =
=
0
4
an =
=/2
;0
4 cos n= 4 Ÿ"1 n1
1
cosŸx cosŸ2nx dx " =
=
"1 4n 2
4n 2 " 1
.
f exp
2 ! 4 Ÿ"1 n1
1
cosŸ2nx =
=
2
4n
"1
n1
4
=
1 1 cosŸ2x " 1 cosŸ4x 1 cosŸ6x " 1 cosŸ8x . . .
3
2
15
35
63
1
0.8
0.6
0.4
0.2
-4
-2
0
2 x
4
In MatLab:
x1-pi/2:.01:pi/2;
y1cos(x1);
x2-3*pi/2:.01:3*pi/2;
y24/pi*(1/2cos(2*x2)/3-cos(4*x2)/15);
y3y24/pi*(cos(6*x2)/63);
clf
plot(x1,y1)
hold
plot(x2,y2,’-.’,x2,y3,’–’)
hold off
2
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-5
-4
-3
-2
-1
0
1
2
3
4
5
2. Sine and Cosine for Half-range Expansions:
Let gŸx be defined for 0 x p, where p 0. Define
f 1 Ÿx f 2 Ÿx gŸx if 0 x p
gŸ"x if " p x 0
gŸx if 0 x p
"gŸ"x if " p x 0
, with period 2p
, with period 2p.
Note that:
a. f 1 Ÿx is an even periodic function and f 2 Ÿx is an odd periodic function.
b. f 1 Ÿx has an cosine series expansion and f 2 Ÿx has an sine series expansion.
Fourier series of f 1 Ÿx and f 2 Ÿx are of the forms:
.
2
f 1 Ÿx a 0 ! a n cos n=
p x , where a 0 p
2
n1
.
f 2 Ÿx ! b n sin
n1
n= x ,
p
p
; 0 fŸx dx,
where b n 2p
a n 2p
p
; 0 fŸx sin
p
; 0 fŸx cos
n= x dx;
p
n= x dx.
p
f 1 Ÿx is represented by a cosine series and f 2 Ÿx is represented by a sine series. Both f 1 Ÿx and f 2 Ÿx are
called half-range expansions of gŸx .
Example For each of the following function, Find its even and odd expansions and sketch the graph of
each expansion in three periods.
Ÿ1 gŸx 2x, 0 x 1. f 1 Ÿx 2x
if 0 x 1
"2x
if " 1 x 0
and f 2 Ÿx 2x, for "1 x 1.
The period: 2 (p 1)
3
-3
-2
2
2
1
1
0
-1
1
x 2
3
-3
0
-1
-2
-2
1
if " = x " =
2
=
=
if "
x
2
2
=
if
x=
2
x=
=
2
="x
x
2
3
"y gŸx , " "y f 2 Ÿx if 0 x =
2 .
=
if
x=
2
=
2
="x
f 1 Ÿx -1
-1
- y gŸx , " "y f 1 Ÿx Ÿ2 gŸx -2
if " = x " =
2
if " = x 0
2
if 0 x =
2
=
if
x=
2
"x " =
"=
2
=
2
="x
and f 2 Ÿx Period T 2= and p =.
2
1.5
1
1
0.5
-8
-6
-4
-2
2
4 x 6
-6
8
-4
-2
0
2
x 4
6
-0.5
-1
-1
-1.5
-2
"y gŸx , " "y f 1 Ÿx "y gŸx , " "y f 2 Ÿx Example Let gŸx 2x, 0 x 1. Find the even half-range expansion of gŸx .
According to Example (1) above, f 1 Ÿx 2x
if 0 x 1
"2x
if " 1 x 0
1
1
0
0
, with period 2 Ÿp 1 .
a 0 2 ; fŸx dx 2 ; 2xdx 2
4
1
1
0
0
a n 2 ; fŸx cosŸn=x dx 2 ; 2x cosŸn=x dx 0
"8
=2n2
4
Ÿcos =n " 1 =2n2
if n 2m
if n 2m 1
f 1 Ÿx 1 " 82
=
.
!
m0
1
cosŸŸ2m 1 =x Ÿ2m 1 2
F 1 Ÿx 1 " 82 cosŸ=x =
F 2 Ÿx 1 " 82 ¡cosŸ=x 1 cosŸ3=x ¢
9
=
F 3 Ÿx 1 " 82 ¡cosŸ=x 1 cosŸ3=x 1 cosŸ5=x ¢
25
9
=
1.8
1.6
1.4
1.2
1
0.8
0.6
0.4
0.2
-3
-2
-1
0
1
x
2
3
yf 1 Ÿx , F 1 Ÿx , F 2 Ÿx , F 3 Ÿx if 0 x =
2 . Find the odd half-range expansion of gŸx .
Example Let gŸx =
if
x=
2
"x " =
if " = x " =
2
=
=
if "
"
x0
2
2
with period 2= Ÿp = According to Example (2) above, f 2 Ÿx =
if 0 x =
2
2
=
="x
if
x=
2
=
2
="x
5
2
bn =
=
; 0 fŸx sinŸnx dx =/2
;0
= sinŸnx dx ; = Ÿ= " x sinŸnx dx
2
=/2
1
1 = sin 2 =n
2 n
n2
2
=
2 sin 12 =n
,
1n =n 2
2
=
recall
sin 12 =n 0 if n 2m
sin 12 =n Ÿ"1 m"1 if n 2m " 1
1
2m
when n 2m
1 ¡1 2Ÿ"1 m"1 ¢ when n 2m " 1
2m " 1
=Ÿ2m " 1 .
f 2 Ÿx !
m1
2Ÿ"1 m"1
1
1
2m " 1
=Ÿ2m " 1 2 sinŸx 1 sinŸ2x F 1 Ÿx Ÿ1 =
2
1
2
F 2 Ÿx F 1 Ÿx Ÿ1 "
sinŸ3x 3
3=
F 3 Ÿx F 2 Ÿx 1 Ÿ1 2 sinŸ5x 5
5=
sinŸŸ2m " 1 x 1 sinŸ2mx 2m
1 sinŸ4x 4
1 sinŸ6x 6
1.5
1
0.5
-8
-6
-4
-2 0
-0.5
2
4x 6
8
-1
-1.5
y f 2 Ÿx , F 1 Ÿx , F 2 Ÿx , F 3 Ÿx Example Find a particular solution to the differential equation:
d2y
m 2 ky fŸt dt
1
, k 4, fŸt =t, for 0 t 1 with T 2.
where m 16
f exp Ÿt =t, " 1 t 1 with period T 2. Find the Fourier series for f exp . Since f exp is an odd
function, its Fourier series is a sine series.
6
bn 1
1
1
; "1 =t sinŸn=t dt " 2n==ncos2 n=
.
f exp Ÿt !
n1
2n Ÿ"1 n1
2 Ÿ"1 n1 sinŸn=t n
The general solution for
2
2
1 d y 4y 0 « d y 64y 0, 5 2 64 0, 5 oi8
2
16 dt
dt 2
y C 1 cosŸ8t C 2 sinŸ8t A particular solution for the nonhomogeneous differential equation:
2
1 d y 4y B n sinŸn=t 16 dt 2
is
y n A n sinŸn=t .
Solve A n by the method of undetermined coefficients:
y Un n=A n cosŸn=t ,
y UUn "Ÿn= 2 A n sinŸn=t " 1 Ÿn= 2 A n sinŸn=t 4A n sinŸn=t B n sinŸn=t 16
An 16B n
,
64 " Ÿn= 2
yn 32Ÿ"1 n1
16B n
sinŸn=t 64 " Ÿn= 2
n 64 " Ÿn= 2
sinŸn=t A particular solution for the differential equation:
2
1 d y 4y f exp Ÿt 16 dt 2
is
y par .
.
n1
n1
! yn !
32Ÿ"1 n1
n 64 " Ÿn= 2
sinŸn=t The general solution of the differential equation:
.
y C 1 cosŸ8t C 2 sinŸ8t !
n1
32Ÿ"1 n1
n 64 " Ÿn= 2
sinŸn=t 7