Assigned: March 1, 2011Due: March 9, 2011
MATH 480: Homework 5SPRING 2011
Fourier Series:
1. (a) Find the Fourier sine series for f(x) = 1 − x defined on the interval 0 ≤ x ≤ 1.
(b) In MATLAB, plot the first 20 terms and the first 200 terms of the sine seriesin the interval −3 ≤ x ≤ 3.
(c) To what value does the series converge at x = 0?
2. (a) Find the Fourier cosine series for f(x) = 1−x defined on the interval 0 ≤ x ≤ 1.
(b) In MATLAB, plot the first 20 terms and the first 200 terms of the cosine seriesin the interval −3 ≤ x ≤ 3.
(c) To what value does the series converge at x = 0?
3. (a) Find the Fourier series for
f(x) =
{0 if − 1 ≤ x < 0
1 − x2 if 0 < x ≤ 1
defined on the interval −1 ≤ x ≤ 1.
(b) In MATLAB, plot the first 20 terms and the first 200 terms of the Fourier seriesin the interval −3 ≤ x ≤ 3.
(c) To what value does the series converge at x = 0?
4. The Fourier series of the function f(x) = cos(ax) on the interval [−π, π], when a isnot an integer, is given by
cos(ax) =2a sin(aπ)
π
[1
2a2+
∞∑n=1
(−1)n+1
n2 − a2cos(nx)
]for − π ≤ x ≤ π.
(a) Differentiate both sides of this equation with respect to x, differentiating theseries term by term, to find the Fourier series for sin(ax):
sin(ax) = −2 sin(aπ)
π
[ ∞∑n=1
(−1)nn
n2 − a2sin(nx)
]for − π < x < π.
(b) Explain why this method for computing the Fourier series is valid.
(c) If you know the Fourier series for sin(ax) given in (a), why can you not dif-ferentiate it term by term with respect to x to derive the Fourier series forcos(ax).
1
Assigned: March 1, 2011Due: March 9, 2011
(d) Now consider the Fourier series of sin(ax) given in (a) as known. Explain whyit can be integrated term by term to get the Fourier expansion of cos(ax).
(e) Carry out this term by term integration from 0 to x, and use it to show that
A0 =sin(aπ)
aπ= 1 +
2a sin(aπ)
π
∞∑n=1
(−1)n
n2 − a2.
5. Let cn be the coefficients of the complex Fourier series of f(x). Show that if f(x) isa real-valued function, then c−n = c̄n.
2
FlVaz2#fl
= ryl4 4 @'(v-r'j , / 'r ={* kt1lr '
==.yF (x-4
,/ 7t7 0x-/ =?E
C)=- / (,/ ,
Laz +4tvJ.* k/r'al ).2,1/-nq1
)Treg22
D"-,t/-"P '"rl tf
/'"-ta-n%
=- --*Vx!q,(?(+-/)r- 7
/= 7l7 x7 O
g.vo.u o 7cs _q # /14,4:o/h 3p,
zA-c** tp Fo un'e-re1
f7t*n'z'r _/
/ -x" o <x<y'
/,") - 4" - )_ /4oaa|!_i_lzdt:'Z!
1/-x')4.K - +
/-/- x') e& n vk zzr .=
1z-x) a'rrz* ax -
,,-r_z tz.flac.lteA ffrzaZl _
M".tuA ef
€rzdnzr
d441-€.x
Fbum'er - l
Assigned: March 1, 2011Due: March 9, 2011
Problem # 1 (b)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% HW # 5: pr1b.m
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear all; clf;
x=-3:1e-3:3;
NN=20;
FS=0;
for n=1:NN
Bn=2/(n*pi);
FS=FS+Bn*sin(n*pi*x);
end
figure(1); clf(1)
subplot(2,1,1), plot(x,FS);
xlabel(’x’)
ylabel([’First ’,num2str(NN), ’ terms of Fourier sine series’])
title([’First ’,num2str(NN), ...
’ terms of the Fourier sine series for the function f(x)=1-x defined on 0<=x<=1’])
axis([-3 3 -1.5 1.5])
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
NN=200;
FS=0;
for n=1:NN
Bn=2/(n*pi);
FS=FS+Bn*sin(n*pi*x);
end
subplot(2,1,2), plot(x,FS);
xlabel(’x’)
ylabel([’First ’ ,num2str(NN), ’ terms of Fourier sine series’])
title([’First ’,num2str(NN), ...
’ terms of the Fourier sine series for the function f(x)=1-x defined on 0<=x<=1’])
axis([-3 3 -1.5 1.5])
print -depsc2 pr1b_graph.eps
Problem # 2 (b)
5
Assigned: March 1, 2011Due: March 9, 2011
−3 −2 −1 0 1 2 3−1.5
−1
−0.5
0
0.5
1
1.5
x
Firs
t 20
term
s of
Fou
rier s
ine
serie
s
First 20 terms of the Fourier sine series for the function f(x)=1−x defined on 0<=x<=1
−3 −2 −1 0 1 2 3−1.5
−1
−0.5
0
0.5
1
1.5
x
Firs
t 200
term
s of
Fou
rier s
ine
serie
s First 200 terms of the Fourier sine series for the function f(x)=1−x defined on 0<=x<=1
Figure 1: Problem 1 (b): Fourier sine series for f(x) = 1− x. Note Gibbs phenomenon atpoints of discontinuity of the Fourier sine series: overshoot of about 0.2. This overshootis about 9% of the function jump: 2 ∗ 0.9 = 0.18
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% HW #5: pr2b.m
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear all; clf;
x=-3:1e-3:3;
NN=20;
FS=1/2;
for n=1:NN
An=2*(1-(-1)^n)/(n^2*pi^2);
FS=FS+An*cos(n*pi*x);
end
figure(1); clf(1)
subplot(2,1,1), plot(x,FS);
xlabel(’x’)
ylabel([’First ’,num2str(NN), ’ terms of Fourier cosine series’])
title([’First ’,num2str(NN), ...
6
Assigned: March 1, 2011Due: March 9, 2011
’ terms of the Fourier cosine series for the function f(x)=1-x defined on 0<=x<=1’])
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
NN=200;
FS=1/2;
for n=1:NN An=2*(1-(-1)^n)/(n^2*pi^2);
FS=FS+An*cos(n*pi*x);
end
subplot(2,1,2), plot(x,FS);
xlabel(’x’)
ylabel([’First ’,num2str(NN), ’ terms of Fourier cosine series’])
title([’First ’,num2str(NN), ...
’ terms of the Fourier cosine series for the function f(x)=1-x defined on 0<=x<=1’])
print -depsc2 pr2b_graph.eps
−3 −2 −1 0 1 2 30
0.2
0.4
0.6
0.8
1
x
Firs
t 20
term
s of
Fou
rier c
osin
e se
ries First 20 terms of the Fourier cosine series for the function f(x)=1−x defined on 0<=x<=1
−3 −2 −1 0 1 2 30
0.2
0.4
0.6
0.8
1
x
Firs
t 200
term
s of
Fou
rier c
osin
e se
ries First 200 terms of the Fourier cosine series for the function f(x)=1−x defined on 0<=x<=1
Figure 2: Problem 2 (b): Fourier cosine series for f(x) = 1 − x. There is no Gibbsphenomenon since Fourier cosine series for f(x) is continuous
7
Assigned: March 1, 2011Due: March 9, 2011
Problem # 3 (b)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% HW # 5: pr3b.m
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear all; clf;
x=-3:1e-3:3;
NN=20;
FS=1/3;
for n=1:NN
An=2*(-1)^(n+1)/(n^2*pi^2);
Bn=(2*(-1)^(n+1)+n^2*pi^2+2)/(n^3*pi^3);
FS=FS+An*cos(n*pi*x)+Bn*sin(n*pi*x);
end
figure(1);clf(1)
subplot(2,1,1), plot(x,FS);
xlabel(’x’)
ylabel([’First ’,num2str(NN), ’ terms,of Fourier series’])
title([’First ’,num2str(NN), ...
’ terms of the Fourier series for the function f(x)=1-x defined on 0<=x<=1’])
axis([-3 3 -0.2 1.2])
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
NN=200;
FS=1/3;
for n=1:NN
An=2*(-1)^(n+1)/(n^2*pi^2);
Bn=(2*(-1)^(n+1)+n^2*pi^2+2)/(n^3*pi^3);
FS=FS+An*cos(n*pi*x)+Bn*sin(n*pi*x);
end
subplot(2,1,2), plot(x,FS);
xlabel(’x’)
ylabel([’First ’,num2str(NN), ’ terms of Fourier series’])
title([’First ’,num2str(NN), ...
’ terms of the Fourier series for the function f(x)=l-x defined on 0<=x<=l’])
axis([-3 3 -0.2 1.2])
8
Assigned: March 1, 2011Due: March 9, 2011
print -depsc2 pr3b_graph.eps
−3 −2 −1 0 1 2 3−0.2
0
0.2
0.4
0.6
0.8
1
1.2
x
Firs
t 20
term
s,of
Fou
rier s
erie
sFirst 20 terms of the Fourier series for the function f(x)=1−x defined on 0<=x<=1
−3 −2 −1 0 1 2 3−0.2
0
0.2
0.4
0.6
0.8
1
x
Firs
t 200
term
s of
Fou
rier s
erie
s
First 200 terms of the Fourier series for the function f(x)=l−x defined on 0<=x<=l
Figure 3: Problem 3 (b): Fourier series for f(x). Note Gibbs phenomenon at points 0,±2, ±4, . . . ,±2n, . . ., n integer, where Fourier series is discontinuous. The overshoot thereis about 0.1 that agrees with the theoretical prediction since function jump is 1, so that9% of it is 1 ∗ 0.09 = 0.09 ≈ 0.1. At points ±1, ±3, . . . ,±(2n + 1), . . ., there is no Gibbsphenomenon since Fourier series is continuous there.
9
/o
{-9:L4zJ 1=?
Z oa,/ (zzr,
-v-<axzT
lzkt/ lraf?<j
/L bh /tr? - / ).- a.alz ltzr/ / "'-12
/(r' /77 - - v4-r,zz /no4!r.z , h zz hrz / '- ? 1/ a ./ .{ J7'/ r't-( -
)* iaalrzr ) L" e€4afi r;Lzatry tZ, ?-1 1 +T-Ati
:+):ze'ry21-
Ahea A, q zz-a/
'r7) = 7n1ar
"4 '/+, ltaza./aaf -&: 1t'?t'*"*,'.*.7
vlzszzt- -r1a7rt: /?/'/c e, /-/J -/ A!Ll-.44€'-, r'oolg+
a)z (a.r t4z!, ra _,{Z}_ aE- - :/2* e.: qe4--.4at Ft-t t /.,2 ?' ,y'2 /42) tllLl-7 4 vtd{ 4rt1az,4
r r u7,a>z 7p zz1/4 zrz at "1 Xa a4 /za-a._
k.€ d€,,"/4/ td( /z.e A 4 761 -4t72)-o 2t
O / zzr+ lt rzz#c;
,Qzt-.ao /z.kr. {i ", z"rrrz-+.2
,q42- /1/- Fzl/szZ
/,/
v_+-E_at.,-r--
,/5;el;s=-4."t?a4= :- /1l*t<4-4 --
l id1Jt)x
' --. - ---=4
-ee,--i4r-.4 lt hk7 /,2*-) 'f ( -/ )
t' ,1=7 //,_4 -
S"Srv2.aty'.
tk -/- Z .44 c,P.J ,,7 y
-4a-:-/:
I
r'"z,
'..) * z - * . nFr/z-c," e
y't) e
aP a6s'7'- r,r'72roro. -=a ff.) = lft;
*{,, e "q:J / /+t e
e-r rr t rrol l l
: C.