Bisection Method
Bisection Method
Bisection Method
Introduction
• Bisection Method:
Function: f(x) = x2 - 4
Roots: x = -2, x = 2
Because:
f(-2) = (-2)2 - 4 = 4 - 4 = 0
f(2) = (2)2 - 4 = 4 - 4 = 0
A Mathematical Property
•Well-known Mathematical Property:
• If a function f(x) is continuous on the interval [a,b] and
sign of f(a) ≠ sign of f(b), then
m = (a+b)/2
The Bisection Method (cont.)
•Example-3
Solve the equation for the
roots lying between 1 and 2 correct up to 2
decimal places using bisection method.
Example 2 : solution
𝑎 +𝑏
N 𝑎 𝑏 𝑥 = 𝑓(𝑎 ) 𝑓(𝑏 ) 𝑓(𝑥 )
2
0 2 3 2.5 -9 1 -5.875
𝑎=𝑎 𝑎 𝑎
𝑏=𝑏
𝑏
𝑏
Process:
𝑏−𝑎
𝐵 𝑏, 𝑓 𝑏
𝑓 𝑏
ℎ
𝑎
𝑎
𝑏 𝑥 𝑏
𝑓 𝑎
𝐴 𝑎, 𝑓 𝑎
Process:
From the given figure we can see that
𝑏−𝑎
triangle ∆𝑂𝐴𝐵 &∆𝑂𝐶𝐷 are similar. D C
Hence,
𝐴𝐵 𝑂𝐴
=
𝐶𝐷 𝑂𝐷 𝑓 𝑏
ℎ 𝑓(𝑎)
=
𝑏−𝑎 𝑓(𝑎) + 𝑓(𝑏) ℎ
𝑓(𝑎) ∗ 𝑏 − 𝑎 𝑎 B
ℎ=
𝑓(𝑎) + 𝑓(𝑏) A 𝑥 𝑏
𝑓 𝑎
𝑥 =𝑎+ℎ
For iterations O
𝑓(𝑎 ) ∗ 𝑏 − 𝑎
ℎ =
𝑓(𝑎 ) + 𝑓(𝑏 )
𝑥 =𝑎 +ℎ
Steps :
• Equation is given make appropriate Function from this call it 𝑓(𝑥)
• Find 𝑎 & 𝑏 in which root is lying between.
• Follow the process …
𝑛 𝑎 𝑏 𝑓(𝑎 ) 𝑓(𝑏 ) 𝑏 −𝑎 ℎ 𝑥 𝑓 𝑥
0 𝑎 𝑏 𝑓(𝑎 ) 𝑓(𝑏 ) 𝑏 −𝑎 ℎ 𝑥 𝑓 𝑥
⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮
⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮
Example 1: using Regula-falsi (RF) method
find the root of function
correct up to 3 significant figures.
• Solution:
Here, 𝑓 𝑥 = 𝑥 + 2𝑥 −2
𝑓 0 = −2 < 0
𝑓 1 =1>0
Hence 𝑓 0 ∗ 𝑓 1 < 0
Hence the required root is in 0,1 = [𝑎, 𝑏]
i.e. 𝑥 ∈ 0,1 , 𝑓𝑜𝑟 𝑤ℎ𝑖𝑐ℎ 𝑓 𝑥 = 0
Taking 𝑎 = 0 & 𝑏 = 1 we have following.
Solution 1:
𝒏 𝒂𝒏 𝒃𝒏 𝒇(𝒂𝒏 ) 𝒇(𝒃𝒏 ) 𝒃𝒏 − 𝒂𝒏 𝒉𝒏 𝒙𝒏 𝟏 𝒇 𝒙𝒏 𝟏
•Example-3
Solve the equation by RF
method correct up to 4 significant places.
Solution 2:
𝒏 𝒂𝒏 𝒃𝒏 𝒇(𝒂𝒏 ) 𝒇(𝒃𝒏 ) 𝒃𝒏 − 𝒂𝒏 𝒉𝒏 𝒙𝒏 𝟏 𝒇 𝒙𝒏 𝟏