Bisection & False Position Methods
Bisection & False Position Methods
Numerical Analysis
CC413
Roots of equations
3. Bisection method
4. False position method
Roots of equations
3
f(x)
Graphical, the root of equation Root
𝑓(𝑥)=0 is intersection point between
𝑓(𝑥) and 𝑥 − 𝑎𝑥𝑖𝑠 as shown in figure
x
Roots of equations
4
𝐸𝑋: 𝑥2 + 1 = 0
x
𝐸𝑥: 𝑥 2 − 1 = 0 -1 +1
𝑥 2 = 1 ⟹ 𝑥 = ±1
From figure, two roots of equation
Roots of equations
5
In Figure a) we have the case of f(xl)
and f(xu) with the same sign, and there
is no root in the interval (xl,xu).
In Figure b) we have the case of f(xl)
and f(xu) With different sign, and there
is a root in the interval (xl,xu).
Given: 𝑓(𝑥) = 0
Required: The root of 𝑓(𝑥) in the interval [𝑥𝑙 , 𝑥𝑢 ]
Solution
We can be solve this problem by using one of
𝑥𝑙 𝑥𝑢
Bisection method
False position method
Secant method
Bisection method
Slide 9
Bisection method
10
Step 1
Estimate the root, 𝑥𝑟 of the equation f (x) = 0 as the mid
point between xl and xu as
f(x)
xu x l f(𝑥𝑢 )
xr
2 𝑥𝑙 𝑥𝑟
𝑥𝑢 x
f(𝑥𝑙 )
Bisection method
11
Step 2
Find the value of 𝑓(𝑥𝑟 ) and select the new interval [𝑥𝑙 , 𝑥𝑟 ]
Or [𝑥𝑟 , 𝑥𝑢 ] such that satisfy Intermediate value theorem
f(x)
f(𝑥𝑢 )
𝑥𝑙 𝑥𝑟
𝑥𝑢 x
f(𝑥𝑟 )
f(𝑥𝑙 )
From figure the new interval is [𝑥𝑟 , 𝑥𝑢 ]
Bisection method
12
Step 3
Find the absolute relative approximate error
x rnew x rold
a new
100
x r
where
x rold previous estimate of root
x rnew current estimate of root
Bisection method
13
Step 4
Compare the absolute relative approximate error a with
the pre-specified error tolerance s (Required accuracy) .
Go to Step 1 using new
Yes upper and lower
Is a s ? guesses.
𝑥𝑙 𝑥𝑢 𝑥𝑟 f(𝑥𝑟 ) 𝜺𝒂
𝑓 𝑥𝑙 = −𝑣𝑒 𝑓 𝑥𝑢 = +𝑣𝑒
1 0 1 0.5 +ve
2 0 0.5 0.25 -ve 100%
3 0.25 0.5 +ve 33.33%
0.375
4 0.25 0.375 0.3125 -ve 20%
5 0.3125 0.375 0.34375 +ve 9.09%
6 0.3125 0.34375 0.32812 4.7%
Bisection method
16
Check: 4 sin 𝑥 − 𝑒 𝑥 = 0
4 sin 𝑥𝑟 − 𝑒 𝑥𝑟 = −0.09
Bisection method
17
Example
Solve using the bisection method the equation
667.38
x
1 e0.146843 x 40 0
Solution
Bisection method
18
f x
667.38
x
1 e0.146843 x 40 0
1 xl 12 f xl 6.067
xu 16 f xu 2.269
𝑥𝑙 𝑥𝑢 𝑥𝑟 f(𝑥𝑟 ) 𝜺𝒂
𝑓 𝑥𝑙 = +𝑣𝑒 𝑓 𝑥𝑢 = −𝑣𝑒
1 12 16 14 +ve
2 14 16 15 -ve 6.66%
3 14 15 14.5 +ve 3.448%
4 14.5 15 14.75 +ve 1.695%
5 14.75 15 14.875 -ve 0.84%
6 14.75 14.875 14.8125 0.422%
Bisection method
20
Solution
𝐥𝐧 𝒙𝒖 − 𝒙𝒍 − 𝐥𝐧(𝜺) 𝒙𝒖 = 𝟏
𝑵>
𝐥𝐧 𝟐 𝒙𝒍 = 𝟎 4
𝐥𝐧 𝟏−𝟎 −𝐥𝐧(𝟎.𝟎𝟎𝟎𝟓)
N> 𝜺 = 𝟎. 𝟓 × 𝟏𝟎−𝒏
𝐥𝐧 𝟐
+ + -
+ - -
+ + -
Define xL, and xu
Yes
𝑥𝑙 + 𝑥𝑢
𝑥𝑟 = Calculate xr
2
Yes
No
f(xL)f(xr) < 0
xL = xr xu = xr
No 𝜖𝑎 <
ϵs
Yes
End 24
False position method
Slide 25
False position method
26
Step 1
Estimate the root, 𝑥𝑟 of the equation f (x) = 0 by
f(x)
𝑓(𝑥𝑢 )(𝑥𝑙 − 𝑥𝑢 )
𝑥𝑟 = 𝑥𝑢 − f(𝑥𝑢 )
𝑓 𝑥𝑙 − 𝑓(𝑥𝑢 )
𝑥𝑙 𝑥𝑟
𝑥𝑢 x
f(𝑥𝑙 )
False position method 27
Step 2
Find the value of 𝑓(𝑥𝑟 ) and select the new interval [𝑥𝑙 , 𝑥𝑟 ]
Or [𝑥𝑟 , 𝑥𝑢 ] such that satisfy Intermediate value theorem
f(x)
f(𝑥𝑢 )
𝑥𝑙 𝑥𝑟
𝑥𝑢 x
f(𝑥𝑟 )
f(𝑥𝑙 )
From figure the new interval is [𝑥𝑟 , 𝑥𝑢 ]
False position method
28
Step 3
Find the absolute relative approximate error
x rnew x rold
a new
100
x r
where
x rold previous estimate of root
x rnew current estimate of root
False position method 29
Step 4
Compare the absolute relative approximate error a with
the pre-specified error tolerance s (Required accuracy) .
Go to Step 1 using new
Yes upper and lower
Is a s ? guesses.
𝑥𝑙 𝑥𝑢 𝑥𝑟 f(𝑥𝑟 ) 𝜺𝒂
𝑓 𝑥𝑙 = −𝑣𝑒 𝑓 𝑥𝑢 = +𝑣𝑒
667.38
x
1 e0.146843 x 40 0
xl 12 xu 16
a 0.5%
Solution
False position method
667.38 35 0.146843 x
f x
x
1 e 40 0
1 xl 12 f xl 6.0669
x u 16 f x u 2.2688
𝑓(𝑥𝑢 )(𝑥𝑙 − 𝑥𝑢 )
𝑥𝑟 = 𝑥𝑢 −
𝑓 𝑥𝑙 − 𝑓(𝑥𝑢 )
−2.2688 12 − 16
𝑥𝑟 = 16 − = 14.9113
6.0669 − −2.2688
𝑓(𝑥𝑢 )(𝑥𝑙 − 𝑥𝑢 )
f x
667.38
x
1 e
0.146843 x
40 0 𝑥𝑟 = 𝑥𝑢 − 𝑓 𝑥 − 𝑓(𝑥 )
36
𝑙 𝑢
Iteration xl xu xr f xr a %
1 12 16 14.9113 -0.2543
2 12 14.9113 14.7942 -0.0273 0.79%
3 12 14.7942 14.7817 0.08%
1 3
𝑥𝑖+1 = (𝑥𝑖 + 5 − 4𝑒 𝑥𝑖 )
20 x0 = 0
𝒊 𝒙𝒊 𝜺𝒂
0 0.05 100%
1 0.03975 25.78%
2 0.04189 5.10%
3 0.04145 1.061% < 𝜀𝑠 = 5%
𝒊 𝒙𝒊 𝜺𝒂
0 0.72131 38.6%
1 0.67862 6.29%
2 0.67747 0.1708% < 𝜀𝑠 = 0.5%