Professional Documents
Culture Documents
5
Problem 1
𝑓(𝑥) = 25𝑥 3 − 6𝑥 2 + 7𝑥 − 88
𝑥 = 2, ℎ = ∆𝑥 = 0.2, 𝑓(𝑥𝑖+1 ) ≅ 𝑓(𝑥𝑖 ) + 𝑓 ′ (𝑥𝑖 ). ℎ
𝑓(𝑥𝑖+1 ) − 𝑓(𝑥𝑖 )
𝐹𝐷𝐷 = 𝑓 ′ (𝑥𝑖 ) = + 𝑂(ℎ2 )
ℎ
𝑥𝑖 = 2
𝑥1+1 = 2 + ∆𝑥
= 2 + 0.2 = 2.2
𝑓(2.2) − 𝑓(2)
=
0.2
𝑓(2) = 102
𝑓(2.2) = 164.56
164.56 − 102
=
0.2
= 312.8
𝑓(𝑥𝑖+1 ) − 𝑓(𝑥𝑖 )
𝐹𝐷𝐷 = 𝑓 ′ (𝑥𝑖 ) = + 𝑂(ℎ2 )
ℎ
𝑥𝑖 = 2
𝑥1+1 = 2 − ∆𝑥
= 2 − 0.2 = 1.8
𝑓(2.2) − 𝑓(2)
=
0.2
𝑓(2) = 102
𝑓(1.8) = 50.96
50.96 − 102
=
0.2
= −255.2
≈ 255.2
𝐴𝑐𝑡𝑢𝑎𝑙 𝑉𝑎𝑙𝑢𝑒,
𝑓(𝑥) = 25𝑥 3 − 6𝑥 2 + 7𝑥 − 88
𝑇𝑎𝑦𝑙𝑜𝑟 𝑠𝑒𝑟𝑖𝑒𝑠:
𝑓"(𝑎)(𝑥 − 𝑎)2
𝑓(𝑥) = 𝑓(𝑎) + 𝑓 ′ (𝑎)(𝑥 − 𝑎) +
2!
𝑎=2 𝑥 = 𝑎 + ∆𝑥 𝑥 − 𝑎 = ∆𝑥 = ∆ℎ
𝑓(2.2) − 𝑓(2)
𝑓 ′ (2) = = 312.8
2.2 − 2
Which is the same as FDD
Problem 2
clc
fnct = @(x) 25*x.^3-6*x.^2+7*x-88;
dfnct = @(x) 75*x.^2-12*x+7;
%-------------------------------------------------------------------------
xFwrd=x(1:end-1); % Forward
dFFwrd=(F(2:end)-F(1:end-1))/h;
xBckwd=x(2:end); % Backward
dFBckwd=(F(2:end)-F(1:end-1))/h;
FDD=dFFwrd
BDD=dFBckwd
FDD =
Columns 1 through 7
217.3800 280.2606
BDD =
Columns 1 through 7
Columns 8 through 9
217.3800 280.2606