Professional Documents
Culture Documents
VU
y f ( xn )
x xn
=
f ( xn 1 ) f ( xn ) xn 1 xn
Setting y=0 in the above equation we get
xn xn 1
f ( xn )
f ( xn ) f ( xn 1 )
Hence the first approximation to the root is given by
xn xn 1
xn +1 = xn
f ( xn )
f ( xn ) f ( xn 1 )
We observe that f ( xn 1 ) and f ( xn +1 ) are of opposite signs thus it is possible to apply the
above procedure, to determine the line through B and A1 and so on.
Hence for successive approximation to the root above formula is used.
x = xn
Example
Use the Regula-Falsi method to compute a real root of the equation x3 9x + 1 = 0,
(i) if the root lies between 2 and 4
(ii) if the root lies between 2 and 3.
Comment on the results.
Solution
Let
f (x) = x3 - 9x + 1
f (2) = 23 - 9(2) + 1=8 18+1= 9and f (4) = 43 - 9(4) + 1=64 36+1=29.
Since f (2) and f (4) are of opposite signs, the root of
f (x) = 0 lies between 2 and 4.
Taking x1 = 2, x2 = 4 and using Regula-Falsi method, the first approximation is given by
x3 = x2
= 4
x2 x1
42
2(29)
(29) = 4
f ( x2 ) = 4
29 (9)
38
f ( x2 ) f ( x1 )
58
= 4 1.5263 = 2.4736
38
VU
Now
f (x3) = 2.47363 - 9(2.4736) + 1=15.13520-22.2624+1= -6.12644.
Since f (x2) and f (x3) are of opposite signs, the root lies between x2 and x3.
The second approximation to the root is given as
x4 = x3
x3 x2
2.4736 4
f ( x3 ) = 2.4736
(6.12644)
6.12644 29
f ( x3 ) f ( x2 )
1.5264
(6.12644) = 2.4736 (0.04345)(6.12644)
35.12644
= 2.4736 + 0.26619 = 2.73989
= 2.4736
Therefore
f (x4) = 2.739893 - 9(2.73989) + 1=20.5683-24.65901+1= =- 3. 090707.
Now, since f (x2) and f (x4) are of opposite signs, the third approximation is obtained
from
x5 = x4
x4 x2
2.73989 4
f ( x4 ) = 2.73989
(3.090707) = 2.86125
f ( x4 ) f ( x2 )
3.090707 29
= 2.73989
1.26011
(3.090707) = 2.73989 + 0.039267(3.090707) = 2.73989 + 0.121363 = 2.86125
32.090707
Now
f (x5) = 2.861253 - 9(2.86125) + 1=23.42434-25.75125+1= -1.326868.
(ii)
Here
f (x) = x3 - 9x + 1
x2 x1
3 2
f ( x2 ) = 3
(1)
f ( x2 ) f ( x1 )
1+ 9
1
= 2.9
10
f (x 3 ) = 2.93 - 9(2.9) + 1 =24.389 26.1+1= 0.711
= 3
Since f (x2) and f (x3) are of opposite signs, the root lies between x2 and x3.
The second approximation to the root is given as
0.1
0.1
2.9 3
x4 = 2.9
(0.711) = 2.9
(0.711) = 2.9
(0.711)
0.711 1
1.711
1.711
= 2.9 (0.05844)(0.711) = 2.9 _ 0.04156 = 2.94156
f ( x4 ) = 0.0207
f (x 4 ) = 2.941563 - 9(2.94156) + 1 =25.45265 26.47404+1= 0.0207
Copyright Virtual University of Pakistan
VU
Now, we observe that f (x2) and f (x4) are of opposite signs; the third approximation is
obtained from
2.94156 3
0.05844
x5 = 2.94156
(0.0207) = 2.94156
(0.0207)
0.0207 1
1.0207
= 2.94156 (0.05725)(0.0207) = 2.94275
f (x 5 ) = 2.942753 - 9(2.94275) + 1 =25.48356 26.48475 +1= 0.0011896
We observe that the value of the root as a third approximation is evidently different in
both the cases, while the value of x5, when the interval considered is
(2, 3), is
closer to the root.
Important observation: The initial interval (x1, x2) in which the root of the equation
lies should be sufficiently small.
Example
Use Regula-Falsi method to find a real root of the equation lnx cos x = 0
accurate to four decimal places after three successive approximations.
Note: here is a transcendental equation all the calculation should be done in the
radians mode
Sol:
f ( x) = ln x - cos x
we have
f(1)=ln1-cos(1)=0-0.540302=-0.540302<0
f(2)=ln2-cos(2)=0.69315-0.41615=1.109
As f(1)f(2)<0 so the root lies between 1and 2
the first approximation is obtained form
2 1
x3 = 2
(1.109)
1.109 + 0.540302
1.1093
= 2
= 1.3275
1.6496
f ( x3 ) = ln 1.3275 - cos 1.3275 = 02833 0.2409 = 0.0424
Now, since f (x1) and f (x3) are of opposite signs, the second approximation is obtained as
(.3275)(.0424)
x4 = 1.3275
0.0424 + 0.5403
= 1.3037
f ( x4 ) = ln 1.3037 - cos 1.3037 =1.24816 103
VU
Similarly, we observe that f (x1) and f (x4) are of opposite signs, so, the third
approximation is given by
x5 = 1.3037
(0.3037)(0.001248)
0.001248 + 0.5403
= 1.3030
f ( x5 ) = 0.6245 104
The required real root is 1.3030
Example:
1 x 2
Solution:
f ( x) = e x + 2 x + 2 cos x 6
x0 = 1 , x1 = 2
now
xn +1 =
xn xn 1
f ( xn )
f ( xn ) f ( xn 1 )
x1 x0
2 1
(0.8068)
f ( x1 ) = 2
f ( x1 ) f ( x0 )
0.8068 + 1.7011
1
(0.8068) = 1.6783
2.5079
f (1.6783) = e1.6783 + 21.6783 + 2 cos(1.6783) 6 = 0.5457
x2 = 2
now for n = 2
x3 = x2
x2 x1
1.6783 2
(0.5457)
f ( x2 ) = 1.6783
(0.5457) 0.8068
f ( x2 ) f ( x1 )
x3 = 1.6783
(0.3217)
(0.5457) = 1.6783 + 0.12979 = 1.8081
(1.3525)
VU
x3 x2
1.8081 1.6783
(0.08575)
f ( x3 ) = 1.8081
(0.08575) + 0.5457
f ( x3 ) f ( x2 )
0.1298
(0.08575) = 1.6783 + 0.12979 = 1.8323
0.45995
f (1.8323) = e1.8323 + 21.8323 + 2 cos(1.8323) 6 = 0.1199
x3 = 1.8081
now for n = 4
x5 = x4
x4 x3
1.8323 1.8081
f ( x4 ) = 1.8323
(0.01199)
f ( x4 ) f ( x3 )
0.01199 + 0.08575
0.0242
(0.01199) = 1.8323 0.00296 = 1.8293
0.09774
f (1.8293) = e1.8293 + 21.8293 + 2 cos(1.8293) 6 = 0.000343
now for n = 5
x5 = 1.8323
x6 = x5
x5 x4
1.8293 1.8323
(0.000343)
f ( x5 ) = 1.8293
f ( x5 ) f ( x4 )
0.000343 0.01199
x6 = 1.8293
(0.003)
(0.000343) = 1.8293
0.012333
Example:
Solve the equation 2 x cos 2 x ( x 2) 2 = 0 2 x 3 Perform only three iterations.
Solution
f ( x) = 2 x cos 2 x ( x 2) 2
here x0 = 2 and x1 = 3
so f (2) = 2(2) cos 4 (2 2) 2 = 4 cos 4 = 2.6146
f (3) = 2(3) cos 2(3) (3 2) 2 = 6 cos 6 1 = 4.7610
here xn +1 = xn
xn xn 1
f ( xn )
f ( xn ) f ( xn 1 )
for n = 1
x2 = x1
x1 x0
3 2
f ( x1 ) = 3
(4.7610)
f ( x1 ) f ( x0 )
4.7610 2.4146
VU
1
(4.7610) = 3 0.6455 = 2.3545
7.3756
f (2.3545) = 2(2.3545) cos 2(2.3545) (2.3545 2) 2 = 4.709 cos 4.709 0.1257 = 0.1416
for n = 2
2.3545 3
x2 x1
(0.1416)
x3 = x2
f ( x2 ) = 2.3545
f ( x2 ) f ( x1 )
0.1416 4.7610
= 3
= 2.3731
f (2.3713) = 2(2.3713) cos 2(2.3713) (2.3713 2) 2 = 4.7462 cos 4.7462 0.1392 = 0.1392
for n = 3
x3 x2
2.3731 2.3545
(0.0212)
x4 = x3
f ( x3 ) = 2.3713
0.0212 + 0.1416
f ( x3 ) f ( x2 )
= 2.3707
f (2.3707) = 2(2.3707) cos 2(2.3707) (2.3707 2) 2 = 4.7414 cos 4.7412 0.1374 = 0.00013
for n = 4
x4 x3
2.3707 2.3731
(0.00013)
x5 = x4
f ( x4 ) = 2.3707
0.00013 0.0212
f ( x4 ) f ( x3 )
= 2.3707