Assignment 4
Assignment 4
Assignment 4
Gold Campus
Numerical Analysis & Computing
By
Mam Humaira Muqadas
Assignment # 4
Steffensen’s Method
𝒇(𝒙𝒏 )𝟐
𝒙𝒏+𝟏 = 𝒙𝒏 −
𝒇(𝒙𝒏 + 𝒇(𝒙𝒏 )) − 𝒇(𝒙𝒏 )
Example-1
Here 𝑥 3 − 𝑥 − 1 = 0
Let 𝑓(𝑥) = 𝑥 3 − 𝑥 − 1
Here
x 0 1 2
f(x) -1 -1 5
Here f(1)=-1<0andf(2)=5>0
1+2
𝑥0 = = 1.5
2
𝑥0 = 1.5
1st iteration :
𝑛=0
(
𝑓 𝑥0 + 𝑓 𝑥0 ( )) = 𝑓(1.5 + 0.875) = 10.0215
𝑓(𝑥0 )2
𝑥1 = 𝑥0 −
𝑓(𝑥0 + 𝑓(𝑥0 )) − 𝑓(𝑥0 )
(0.875)2
𝑥1 = 1.5 −
10.0215 − 0.875
𝑥1 = 1.4163
2nd iteration :
𝑛=1
(
𝑓 𝑥1 + 𝑓 𝑥1 ( )) = 𝑓(1.4163 + 0.4246) = 3.398
𝑓(𝑥1 )2
𝑥2 = 𝑥1 −
𝑓(𝑥1 + 𝑓(𝑥1 )) − 𝑓(𝑥1 )
(0.4246)2
𝑥2 = 1.4163 −
3.398 − 0.4246
𝑥2 = 1.3557
3rd iteration :
𝑛=2
(
𝑓 𝑥2 + 𝑓 𝑥2 ( )) = 𝑓(1.3557 + 0.1357) = 0.8259
𝑓(𝑥2 )2
𝑥3 = 𝑥2 −
𝑓(𝑥2 + 𝑓(𝑥2 )) − 𝑓(𝑥2 )
(0.1357)2
𝑥3 = 1.3557 −
0.8259 − 0.1357
𝑥3 = 1.3289
4th iteration :
𝑛=3
(
𝑓 𝑥3 + 𝑓 𝑥3 ( )) = 𝑓(1.3289 + 0.0181) = 0.0973
𝑓(𝑥3 )2
𝑥4 = 𝑥3 −
𝑓(𝑥3 + 𝑓(𝑥3 )) − 𝑓(𝑥3 )
(0.0181)2
𝑥4 = 1.3289 −
0.0973 − 0.0181
𝑥4 = 1.3248
5th iteration :
𝑛=4
(
𝑓 𝑥4 + 𝑓 𝑥4 ( )) = 𝑓(1.3248 + 0.0004) = 0.0019
𝑓(𝑥4 )2
𝑥5 = 𝑥4 −
𝑓(𝑥4 + 𝑓(𝑥4 )) − 𝑓(𝑥4 )
(0.0004)2
𝑥5 = 1.3248 −
0.0019 − 0.0004
𝑥5 = 1.3247
Approximate root of the equation 𝑥 3 − 𝑥 − 1 = 0 using Steffensen's method is 1.3247 (After 5 iterations)
𝒏 𝒙𝟎
𝒇 𝒙𝟎( ) ( ( ))
𝒇 𝒙 𝟎 + 𝒇 𝒙𝟎
𝒙𝟏
Solution:
Here 2𝑥 3 − 2𝑥 − 5 = 0
Let 𝑓(𝑥) = 2𝑥 3 − 2𝑥 − 5
Here
x 0 1 2
f(x) -5 -5 7
Here f(1)=-5<0andf(2)=7>0
1+2
𝑥0 = = 1.5
2
𝑥0 = 1.5
1st iteration :
𝑛=0
(
𝑓 𝑥0 + 𝑓 𝑥0 ( )) = 𝑓(1.5 ± 1.25) = −5.4688
𝑓(𝑥0 )2
𝑥1 = 𝑥0 −
𝑓(𝑥0 + 𝑓(𝑥0 )) − 𝑓(𝑥0 )
(−1.25)2
𝑥1 = 1.5 −
−5.4688 − (−1.25)
𝑥1 = 1.8704
2nd iteration :
𝑛=1
(
𝑓 𝑥1 + 𝑓 𝑥1 ( )) = 𝑓(1.8704 + 4.3454) = 462.8797
𝑓(𝑥1 )2
𝑥2 = 𝑥1 −
𝑓(𝑥1 + 𝑓(𝑥1 )) − 𝑓(𝑥1 )
(4.3454)2
𝑥2 = 1.8704 −
462.8797 − 4.3454
𝑥2 = 1.8292
3rd iteration :
𝑛=2
(
𝑓 𝑥2 + 𝑓 𝑥2 ( )) = 𝑓(1.8292 + 3.5823) = 301.1224
𝑓(𝑥2 )2
𝑥3 = 𝑥2 −
𝑓(𝑥2 + 𝑓(𝑥2 )) − 𝑓(𝑥2 )
(3.5823)2
𝑥3 = 1.8292 −
301.1224 − 3.5823
𝑥3 = 1.7861
4th iteration :
𝑛=3
(
𝑓 𝑥3 + 𝑓 𝑥3 ( )) = 𝑓(1.7861 + 2.823) = 181.6021
𝑓(𝑥3 )2
𝑥4 = 𝑥3 −
𝑓(𝑥3 + 𝑓(𝑥3 )) − 𝑓(𝑥3 )
(2.823)2
𝑥4 = 1.7861 −
181.6021 − 2.823
𝑥4 = 1.7415
5th iteration :
𝑛=4
(
𝑓 𝑥4 + 𝑓 𝑥4 ( )) = 𝑓(1.7415 + 2.0801) = 98.978
𝑓(𝑥4 )2
𝑥5 = 𝑥4 −
𝑓(𝑥4 + 𝑓(𝑥4 )) − 𝑓(𝑥4 )
(2.0801)2
𝑥5 = 1.7415 −
98.978 − 2.0801
𝑥5 = 1.6968
Approximate root of the equation 2𝑥 3 − 2𝑥 − 5 = 0 using Steffensen's method is 1.6968 (After 11 iterations)
𝒏 𝒙𝟎
( )
𝒇 𝒙𝟎 ( ( ))
𝒇 𝒙𝟎 + 𝒇 𝒙𝟎
𝒙𝟏
Solution:
𝐻𝑒𝑟𝑒 𝑥 3 + 2𝑥 2 + 𝑥 − 1 = 0
𝐿𝑒𝑡 𝑓(𝑥) = 𝑥 3 + 2𝑥 2 + 𝑥 − 1
Here
x 0 1
f(x) -1 3
Here f(0)=-1<0andf(1)=3>0
0+1
𝑥0 = = 0.5
2
𝑥0 = 0.5
1st iteration :
𝑛=0
(
𝑓 𝑥0 + 𝑓 𝑥0 ( )) = 𝑓(0.5 + 0.125) = 0.6504
𝑓(𝑥0 )2
𝑥1 = 𝑥0 −
𝑓(𝑥0 + 𝑓(𝑥0 )) − 𝑓(𝑥0 )
(0.125)2
𝑥1 = 0.5 −
0.6504 − 0.125
𝑥1 = 0.4703
2nd iteration :
𝑛=1
(
𝑓 𝑥1 + 𝑓 𝑥1 ( )) = 𝑓(0.4703 + 0.0165) = 0.0761
𝑓(𝑥1 )2
𝑥2 = 𝑥1 −
𝑓(𝑥1 + 𝑓(𝑥1 )) − 𝑓(𝑥1 )
𝑥2 = 0.4657
3rd iteration :
𝑛=2
(
𝑓 𝑥2 + 𝑓 𝑥2 ( )) = 𝑓(0.4657 + 0.0003) = 0.0015
𝑓(𝑥2 )2
𝑥3 = 𝑥2 −
𝑓(𝑥2 + 𝑓(𝑥2 )) − 𝑓(𝑥2 )
(0.0003)2
𝑥3 = 0.4657 −
0.0015 − 0.0003
𝑥3 = 0.4656
𝒏 𝒙𝟎
( )
𝒇 𝒙𝟎 ( ( ))
𝒇 𝒙𝟎 + 𝒇 𝒙𝟎
𝒙𝟏