Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Superior University

Gold Campus
Numerical Analysis & Computing
By
Mam Humaira Muqadas

Obaidullah Mansoor BCSM-S20-006


Zohaib Tahir BCSM-S20-041
Mustatab Safdar BCSM-S20-047

Assignment # 4
Steffensen’s Method
𝒇(𝒙𝒏 )𝟐
𝒙𝒏+𝟏 = 𝒙𝒏 −
𝒇(𝒙𝒏 + 𝒇(𝒙𝒏 )) − 𝒇(𝒙𝒏 )
Example-1

Find a root of an equation 𝒇(𝒙) = 𝒙𝟑 − 𝒙 − 𝟏 using Steffensen's method


Solution:

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

Root lies between 1 and 2

1+2
𝑥0 = = 1.5
2
𝑥0 = 1.5

1st iteration :

𝑛=0

( ) = 𝑓(1.5) = 1.5 − 1.5 − 1 = 0.875


𝑓 𝑥0 3

(
𝑓 𝑥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.4163) = (1.4163) − 1.4163 − 1 = 0.4246


𝑓 𝑥1 3

(
𝑓 𝑥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

( ) = 𝑓(1.3557) = (1.3557) − 1.3557 − 1 = 0.1357


𝑓 𝑥2 3

(
𝑓 𝑥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

( ) = 𝑓(1.3289) = (1.3289) − 1.3289 − 1 = 0.0181


𝑓 𝑥3 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

( ) = 𝑓(1.3248) = (1.3248) − 1.3248 − 1 = 0.0004


𝑓 𝑥4 3

(
𝑓 𝑥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)

𝒏 𝒙𝟎
𝒇 𝒙𝟎( ) ( ( ))
𝒇 𝒙 𝟎 + 𝒇 𝒙𝟎
𝒙𝟏

1 1.5 0.875 10.0215 1.4163

2 1.4163 0.4246 3.398 1.3557

3 1.3557 0.1357 0.8259 1.3289

4 1.3289 0.0181 0.0973 1.3248

5 1.3248 0.0004 0.0019 1.3247


Example-2
Find a root of an equation 𝒇(𝒙) = 𝟐𝒙𝟑 − 𝟐𝒙 − 𝟓 using Steffensen's method

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

Root lies between 1 and 2

1+2
𝑥0 = = 1.5
2
𝑥0 = 1.5

1st iteration :

𝑛=0

( ) = 𝑓(1.5) = 2(1.5) − 2(1.5) − 5 = −1.25


𝑓 𝑥0 3

(
𝑓 𝑥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.8704) = 2(1.8704) − 2(1.8704) − 5 = 4.3454


𝑓 𝑥1 3

(
𝑓 𝑥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

( ) = 𝑓(1.8292) = 2(1.8292) − 2(1.8292) − 5 = 3.5823


𝑓 𝑥2 3

(
𝑓 𝑥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

( ) = 𝑓(1.7861) = 2(1.7861) − 2(1.7861) − 5 = 2.823


𝑓 𝑥3 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

( ) = 𝑓(1.7415) = 2 ⋅ 1.74153 − 2 ⋅ 1.7415 − 5 = 2.0801


𝑓 𝑥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)

𝒏 𝒙𝟎
( )
𝒇 𝒙𝟎 ( ( ))
𝒇 𝒙𝟎 + 𝒇 𝒙𝟎
𝒙𝟏

1 1.5 -1.25 -5.4688 1.8704

2 1.8704 4.3454 462.8797 1.8292

3 1.8292 3.5823 301.1224 1.7861

4 1.7861 2.823 181.6021 1.7415

5 1.7415 2.0801 98.978 1.6968


Example-3
Find a root of an equation 𝒇(𝒙) = 𝒙𝟑 + 𝟐𝒙𝟐 + 𝒙 − 𝟏 using Steffensen's method

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

∴ Root lies between 0 and 1

0+1
𝑥0 = = 0.5
2
𝑥0 = 0.5

1st iteration :

𝑛=0

( ) = 𝑓(0.5) = 0.5 + 2 ⋅ 0.5 + 0.5 − 1 = 0.125


𝑓 𝑥0 3 2

(
𝑓 𝑥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

( ) = 𝑓(0.4703) = 0.4703 + 2 ⋅ 0.4703 + 0.4703 − 1 = 0.0165


𝑓 𝑥1 3 2

(
𝑓 𝑥1 + 𝑓 𝑥1 ( )) = 𝑓(0.4703 + 0.0165) = 0.0761
𝑓(𝑥1 )2
𝑥2 = 𝑥1 −
𝑓(𝑥1 + 𝑓(𝑥1 )) − 𝑓(𝑥1 )

𝑥2 = 0.4703 − (0.0165)20.0761 − 0.0165

𝑥2 = 0.4657

3rd iteration :

𝑛=2

( ) = 𝑓(0.4657) = 0.46573 + 2 ⋅ 0.46572 + 0.4657 − 1 = 0.0003


𝑓 𝑥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

Approximate root of the equation 𝑥 3 + 2𝑥 2 + 𝑥 − 1 = 0 using Steffensen's method is 0.4656 (After 3


iterations)

𝒏 𝒙𝟎
( )
𝒇 𝒙𝟎 ( ( ))
𝒇 𝒙𝟎 + 𝒇 𝒙𝟎
𝒙𝟏

1 0.5 0.125 0.6504 0.4703

2 0.4703 0.0165 0.0761 0.4657

3 0.4657 0.0003 0.0015 0.4656

You might also like