Sunteți pe pagina 1din 16

NUMERICAL ANALYSIS

Lecture -5

Dr. Muhammad Rafiq


Assistant Professor
University of Central Punjab
Lahore Pakistan

Page 1 of 16
Method of False Position

Let 𝑦 = 𝑓(𝑥) be a function whose graph crosses the x-axis between two points
A (𝑥0, 𝑦0 ) and B (𝑥1, 𝑦1 ). This means that there exists a root between𝑥0 𝑎𝑛𝑑 𝑥1 .

Also 𝑓(𝑥0 )𝑓 (𝑥1 ) < 0


Equation of the chord AB is given by

𝑦 − 𝑦0 𝑥 − 𝑥0
=
𝑦1 − 𝑦0 𝑥1 − 𝑥0

Suppose the chord AB cuts the x-axis at (x2, 0)

Page 2 of 16
0 − 𝑦0 𝑥2 − 𝑥0
=
𝑦1 − 𝑦0 𝑥1 − 𝑥0

−𝑓(𝑥0 ) 𝑥2 − 𝑥0
=
𝑓(𝑥1 ) − 𝑓(𝑥0 ) 𝑥1 − 𝑥0

−(𝑥1 − 𝑥0 )𝑓(𝑥0 ) 𝑥2 − 𝑥0
=
𝑓(𝑥1 ) − 𝑓(𝑥0 ) 1

𝑓(𝑥0 )(𝑥1 − 𝑥0 )
𝑥2 = 𝑥0 − … … (𝑖)
𝑓(𝑥1 ) − 𝑓(𝑥0 )

Page 3 of 16
If 𝑓(𝑥1 )𝑓(𝑥2 ) < 0 then the root lies between x1 and x2 so replacing x1 by x2 in
equation (i) we obtain the next approximation.

𝑓(𝑥1 )(𝑥2 − 𝑥1 )
𝑥3 = 𝑥1 −
𝑓(𝑥2 ) − 𝑓(𝑥1 )
On generalization

𝑓(𝑥𝑛 )(𝑥𝑛 − 𝑥𝑛−1 )


𝑥𝑛+1 = 𝑥𝑛−1 −
𝑓(𝑥𝑛 ) − 𝑓(𝑥𝑛−1 )

(𝑥𝑛−1 (𝑓𝑥𝑛 −𝑓(𝑥𝑛−1 ))−𝑓(𝑥𝑛−1 )(𝑥𝑛−1 )(𝑥𝑛 −𝑥𝑛−1 )


= 𝑓(𝑥𝑛 )−𝑓(𝑥𝑛−1 )

𝑥𝑛−1 𝑓(𝑥𝑛 )−𝑥𝑛−1 𝑓(𝑥𝑛−1 )−𝑥𝑛 𝑓(𝑥𝑛−1 )+𝑥𝑛−1 𝑓(𝑥𝑛−1 )


= 𝑓(𝑥𝑛 )−𝑓(𝑥𝑛−1 )
Page 4 of 16
𝑥𝑛−1 𝑓 (𝑥𝑛 ) − 𝑥𝑛 𝑓(𝑥𝑛−1 )
𝑥𝑛+1 =
𝑓 (𝑥𝑛 ) − 𝑓(𝑥𝑛−1 )
Example .1
Find out one real root of the equation 𝑥 3 − 4𝑥 − 9 = 0
Use the method of false position in four stages.
Solution:-
f (x) =x3-4x-9
f (2) =23-4(2)-9= -9
f (3) =33-4(3)-9= 6

f (2) f(3) = -54 <0 therefore the root lies between 2 and 3.
Taking x0 = 2 and x1 = 3
Page 5 of 16
1st approximation
𝑥𝑛−1 𝑓 (𝑥𝑛 ) − 𝑥𝑛 𝑓(𝑥𝑛−1 )
𝑥𝑛+1 =
𝑓 (𝑥𝑛 ) − 𝑓(𝑥𝑛−1 )
n=1
𝑥1−1 𝑓(𝑥1 ) − 𝑥1 𝑓(𝑥1−1 )
𝑥1+1 =
𝑓(𝑥1 ) − 𝑓(𝑥0 )
𝑥0 𝑓(𝑥1 ) − 𝑥1 𝑓(𝑥0 )
𝑥2 =
𝑓(𝑥1 ) − 𝑓(𝑥0 )
2 𝑓(3) − 3𝑓(2)
𝑥2 =
𝑓(3) − 𝑓(2)
2 (6) − 3(−9)
𝑥2 =
6 − (−9)
13
𝑥2 =
5

Page 6 of 16
𝑥2= 2.6
𝑓(2.6) = −1.824
Since f (2.60) f (3) < 0 therefore the root lies between 2.60 and 3.
2nd approximation
𝑥 1=2.60
𝑥 2=3
𝑥2−1 𝑓(𝑥2 )−𝑥2 𝑓(𝑥2−1 )
n=2 𝑥2+1 =
𝑓(𝑥2 )−𝑓( 𝑥2−1 )

𝑥1 𝑓(𝑥2 ) − 𝑥2 𝑓(𝑥1 )
𝑥3 =
𝑓(𝑥2 ) − 𝑓(𝑥1 )
2.60(6) − 3(−1.824)
𝑥3 =
6 − (−1.824)
𝑥3= 2.693
𝑓 (2.693) = −0.2417
Page 7 of 16
Since 𝑓(2.693)𝑓(3) < 0 therefore the root lies between 2.693 and 3.
3rd approximation
𝑥 2=2.693
𝑥3= 3
𝑥3−1 𝑓(𝑥3 )−𝑥3 𝑓(𝑥3−1 )
n=3 𝑥3+1 =
𝑓(𝑥3 )−𝑓(𝑥3−1 )

𝑥2 𝑓(𝑥3 ) − 𝑥3 𝑓(𝑥2 )
𝑥4 =
𝑓(𝑥3 ) − 𝑓(𝑥2 )
2.693 (6) − 3(−0.2417 )
𝑥4 =
6 − (−0.2417 )
𝑥4= 2.705
𝑓 (2.705) = −0.02744
𝑓(2.705)𝑓(3) < 0 therefore the root lies between 2.705 and 3.

Page 8 of 16
4th approximation
𝑥3 = 2.7050 𝑥4 = 3
𝑥3 𝑓(𝑥4 )−𝑥4 𝑓(𝑥3 )
n=4 𝑥5 =
𝑓(𝑥4 )−𝑓(𝑥3 )

2.7050 (6)−3(−0.02744)
𝑥5 =
6−(−0.02744 )

𝑥5 = 2.7063
The result of four approximations is as follows:-
2.6000
2.6930
2.7050
2.7063
On making more approximations we get better accuracy of result in terms of
decimal places.

Page 9 of 16
Example.2
Find one real root of the equation 𝑥𝑒 𝑥 = 2 using Method of False Position
correct to 4 d.p
Solution:
f(x) =Xex-2
f (0) =0(e0)-2=-2 <0
f (1) =1(e1)-2=0.71828 >0
Therefore the root lies between 0 and 1.
1st approximation
𝑥 0=0 𝑥 1=1
𝑥1−1 𝑓(𝑥1 )−𝑥1 𝑓(𝑥1−1 )
n=1 𝑥1+1 =
𝑓(𝑥1 )−𝑓(𝑥0 )
𝑥0 𝑓(𝑥1 ) − 𝑥1 𝑓(𝑥0 )
𝑥2 =
𝑓(𝑥1 ) − 𝑓(𝑥0 )

Page 10 of 16
0 (0.71828) − 1(−2)
𝑥2 =
0.71828 − (−2)
𝑥2= 0.73576
𝑓 (0.73576) = 0.73576𝑒 0.73576 − 2
𝑓 (0.73576) = −0.46442 <0
𝑓 (0.73576)𝑓(1) < 0 there fore the root lies between 0.73576 and 1.
2nd approximation
𝑥 1=0.73576
𝑥 2=1
𝑥1 𝑓(𝑥2 )−𝑥2 𝑓(𝑥1 )
n=2 𝑥3 =
𝑓(𝑥2 )−𝑓(𝑥1 )

0.73576(0.718280) − 1(−0.46442)
𝑥3 =
0.718280 − (−0.46442)

Page 11 of 16
𝑥3= 0.83952
𝑓(0.83952) = 0.83952𝑒 0.83952 − 2
𝑓 (0.83952) = −0.056297 <0
𝑓 (0.83952)𝑓(1) < 0 therefore the root lies between 0.73576 and 1.
3rd approximation
𝑥 2=0.83952
𝑥3= 1
𝑥3−1 𝑓(𝑥3 )−𝑥3 𝑓(𝑥3−1 )
n=3 𝑥3+1 =
𝑓(𝑥3 )−𝑓(𝑥3−1 )

𝑥2 𝑓(𝑥3 ) − 𝑥3 𝑓(𝑥2 )
𝑥4 =
𝑓(𝑥3 ) − 𝑓(𝑥2 )
0.83952(0.71828) − 1(−0.056297 )
𝑥4 =
0.71828 − (−0.056297 )

Page 12 of 16
𝑥4= 0.851184
𝑓 (0.851184) = 0.851184𝑒 0.851184 − 2
𝑓 (0.851184) = −6.1707 𝑋10−3 <0
𝑓 (0.851184)𝑓 (1) < 0 therefore the root lies between 0.851184 and 1.
4th approximation
𝑥3= =0.851184
𝑥4= 1
𝑥3 𝑓(𝑥4 )−𝑥4 𝑓(𝑥3 )
n=4 𝑥5 =
𝑓(𝑥4 )−𝑓(𝑥3 )

0.851184 (0.71828) − 1(−6.1707 𝑋10−3 )


𝑥5 =
0.71828 − (−6.1707 𝑋10−3 )
𝑥5= 0.85245
𝑓 (0.85245) = 0.85245𝑒 0.85245 − 2

Page 13 of 16
𝑓 (0.85245) = −6.75692 𝑋10−4 <0
𝑓 (0.85245)𝑓(1) < 0 therefore the root lies between 0.85245 and 1.
5th approximation
𝑥4 =0.85245
𝑥5= 1
𝑥4 𝑓(𝑥5 )−𝑥5 𝑓(𝑥4 )
n=5 𝑥6 =
𝑓(𝑥5 )−𝑓(𝑥4 )

0.85245 (0.71828) − 1(−6.75692 𝑋10−4 )


𝑥6 =
0.71828 − (−6.75692 𝑋10−4 )
𝑥6= 0.85259
𝑓(0.85259) = 0.85259𝑒 0.852595 − 2
𝑓 (0.85259) = −6.73671 𝑋10−5 <0
𝑓 (0.85245)𝑓(1) < 0 therefore the root lies between 0.85259 and 1.

Page 14 of 16
6th approximation
𝑥5 =0.85259
𝑥6= 1
𝑥5 𝑓(𝑥6 )−𝑥6 𝑓(𝑥5 )
n=6 𝑥7 =
𝑓(𝑥6 )−𝑓(𝑥5 )

0.85259 (0.71828) − 1(−6.73671 𝑋10−5 )


𝑥7 =
0.71828 − (−6.73671 𝑋10−5 )
𝑥7= 0.85260

𝑥6= 0.85259. By rounding it off we get 0.8526 which is equal to 𝑥7= 0.85260
and gives us an accuracy of 5 decimal places.

Page 15 of 16
Exercise
Solve the following equations using Method of False Position correct to 4d.p
i) x = cos(x)
ii) x log x = 1.2
iii) 𝒙𝟑 − 𝒙𝟐 + 𝒙 − 𝟕 = 𝟎
iv) 𝒙𝟑 +x-1=0

Page 16 of 16

S-ar putea să vă placă și