Beruflich Dokumente
Kultur Dokumente
if 1 x < 0
if 0 < x 1
X
2a sin(a) 1
(1)n+1
cos(ax) =
+
cos(nx)
2a2
n2 a2
for
x .
n=1
(a) Differentiate both sides of this equation with respect to x, differentiating the
series term by term, to find the Fourier series for sin(ax):
"
#
2 sin(a) X (1)n n
sin(nx)
sin(ax) =
n2 a2
for
< x < .
n=1
(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 differentiate it term by term with respect to x to derive the Fourier series for
cos(ax).
(d) Now consider the Fourier series of sin(ax) given in (a) as known. Explain why
it 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)
2a sin(a) X (1)n
=1+
.
a
n2 a2
n=1
5. Let cn be the coefficients of the complex Fourier series of f (x). Show that if f (x) is
a real-valued function, then cn = cn .
{* kt1lr
= ryl4
'
FlVaz2#fl
4 @'(v-r'j , /
'r =
==.yF(x-4
, / 7t7
x-/ =?E
C)=- / (,/ ,
Laz + 4tvJ
.*
k/r'al
).2,1/-nq1
)Treg22
D"-,t/-"P
'"rl tf
/'"-ta-n%
=-
--*Vx!q,(?(+-/)
/= 7
l7
r-
x7 O
_q # /14,4 :o/h
g.vo.u o 7cs
3p,
zA-c** tp Fo un'e-r
e1
f7t*n'z'r
_/
/- x "
o <x<y'
1/-x')4.K - +
/-/- x') e& n vk zzr .=
ffrzaZl
_
M".tuA
rzdnzr
d441-.x
Fbum'er
-l
ef
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
First 20 terms of the Fourier sine series for the function f(x)=1x defined on 0<=x<=1
1.5
1
0.5
0
0.5
1
1.5
3
0
x
First 200 terms of the Fourier sine series for the function f(x)=1x defined on 0<=x<=1
1.5
1
0.5
0
0.5
1
1.5
3
0
x
Figure 1: Problem 1 (b): Fourier sine series for f (x) = 1 x. Note Gibbs phenomenon at
points of discontinuity of the Fourier sine series: overshoot of about 0.2. This overshoot
is 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
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])
First 20 terms of the Fourier cosine series for the function f(x)=1x defined on 0<=x<=1
1
0.8
0.6
0.4
0.2
0
3
0
x
First 200 terms of the Fourier cosine series for the function f(x)=1x defined on 0<=x<=1
1
0.8
0.6
0.4
0.2
0
3
0
x
Figure 2: Problem 2 (b): Fourier cosine series for f (x) = 1 x. There is no Gibbs
phenomenon since Fourier cosine series for f (x) is continuous
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
First 20 terms of the Fourier series for the function f(x)=1x defined on 0<=x<=1
1.2
1
0.8
0.6
0.4
0.2
0
0.2
3
0
x
First 200 terms of the Fourier series for the function f(x)=lx defined on 0<=x<=l
1
0.8
0.6
0.4
0.2
0
0.2
3
0
x
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 there
is about 0.1 that agrees with the theoretical prediction since function jump is 1, so that
9% of it is 1 0.09 = 0.09 0.1. At points 1, 3, . . . , (2n + 1), . . ., there is no Gibbs
phenomenon since Fourier series is continuous there.
/o
{-9:L4zJ 1=?
oa,/ (zzr,
-v-<axzT
lraf?<j
lzkt/
/L bh /tr?
.- a.alz ltzr
/(r' /77 -
-/ )
/ / "'-12
- v4-r,zz
, h zz hrz /
/no4!r.z
L" e4afir;Lzatry
)* iaalrzr )
'-
J7'/r't-( -
? 1/ a ./.{
:+):ze'ry21'r7)= 7n1ar
vlzszzt- -r1a7rt:
"4 '/+,
/?/'/c e,
a)z(a.r
.4at
Ft-t
t /.,2
,y'2/42)
?'
d,,"/4/
td(
/z.eA 4
O/
tllLl-7
vtd{
zzr+
761-4t72)-o
lt
Ahea
/z.kr.
,Qzt-.ao
,q42-
/1/-
Fzl/szZ
4rt1az,4
rru7,a>z
k.
-&: 1t'?t'*"*,'.*.7
ltaza./aaf
{i
",
2t
rzz#c;
A, q
zz-a/
z"rrrz-+.2
/,/
v_+-E_at.,-r--
:- /1l*t<4-4 --
,/5;el;s=-4."t?a4=
S"Srv2.aty'.
'
lid1Jt)x
tk -/-
-4a-:-/:
.44 c,P.J,,7y
-ee,--i4r-
'f
( -/ )
,1=7 //,_4
r'"z
'..)
c,"
e
*. nFr/z-
y't) e
= lft;
*{,, e
e-r
/ /+t
"q:J
rrtrrolll
C.