You are on page 1of 10

College of Engineering Pune

Department of Mechanical Engineering

Computational Methods & Programming

Welcome!!
Session 4
Bracketing methods for
finding out roots of
equations
Bracketing methods
• Now we will study the methods that exploit the fact that a function
typically changes sign in the vicinity of a root.

• These techniques are called bracketing methods because two initial


guesses for the root are required.

• As the name implies, these guesses must “bracket,” or be on either side


of, the root.

• The particular methods described herein employ different strategies to


systematically reduce the width of the bracket and, hence, home in on the
correct answer.

• To initiates to such methods, we have already discussed the graphical


methods for depicting functions and their roots.

• This is useful for providing rough initial guesses required for graphical
methods.
Bisection method
Step 1: Choose lower x1 and upper x2 guesses for the root such that the
function changes sign over the interval.
This can be checked by ensuring that f (x1)*f(x2) < 0 or
Sign of f(x1) and f(x2) are opposite.

Step 2: The first approximate root estimation is to be done by considering


the midpoint of x1 and x2 Y = f(x)
f(x2)
Y = f(x)
F(x3)

x1

x x3 x2

f(x1) X3 = (x1 + x2 )/2


Y = f(x)
f(x2)

x1 x3
x x2
F(x3)

f(x1)
X3 = (x1 + x2 )/2

Y = f(x)
f(x2)

x1 x3

x x2
F(x1) F(x3)

X3 = (x1 + x2 )/2
Bisection method
3 2
𝑓 𝑥 = 𝑥 − 𝑥 − 20
Step 1: let’s assume initial guess starting from 0 with the step size of 1.
First guess x = 0 and f(x) = - 20
Second guess x = 1 and f(x) = - 20
Third guess x = 2 and f(x) = - 16
Fourth guess x = 3 and f(x) = - 2
Fifth guess x = 4 and f(x) = 28
Sixth guess x = 5 and f(x) = 80
The sign of function changes between guesses 3 and 4,
hence select x1 = 3 and x2 = 4
OR
Also check whether f (x1)*f(x2) < 0
x = 3 and f(x) = - 2 and x = 4 and f(x) = 28
So f (x1)*f(x2) = - 2*28 = -56 which is < 0
Hence initial guesses are correct.
Step 2: Find out x3 which is nothing but next approximated root bracketing
first two initial guesses.
x3 = (x1 + x2) / 2 i.e. = (3 + 4) /2 = 3.5
Bisection method
3 2
𝑓 𝑥 = 𝑥 − 𝑥 − 20
Step 3: Find f (x3) and check the sign.
x3 = 3.5 hence f(x3) = 10.62 (Positive)

Hence we have to replace x2 with x3

Therefore new initial guesses are:


x1 = 3 as it is and x2 = 3.5
Find new x3 between x1 = 3 and x2 = 3.5
X3 = (3 + 3.5) / 2 = 3.25

Find f (x3) and check the sign.


x3 = 3.25 hence f(x3) = 3.76 (Positive)

Hence again replace x2 with x3


Therefore new initial guesses are:
x1 = 3 as it is and x2 = 3.25
Find new x3 between x1 = 3 and x2 = 3.25
X3 = (3 + 3.25) / 2 = 3.125
Bisection method
3 2
𝑓 𝑥 = 𝑥 − 𝑥 − 20
Step 3: Find f (x3) and check the sign.
x3 = 3.125 hence f(x3) = 0.75 (Positive)

Hence we have to replace x2 with x3

Therefore new initial guesses are:


x1 = 3 as it is and x2 = 3.125
Find new x3 between x1 = 3 and x2 = 3.125
X3 = (3 + 3.125) / 2 = 3.06

Find f (x3) and check the sign.


x3 = 3.06 hence f(x3) = -0.71 (negative)

Hence again replace x1 with x3


Therefore new initial guesses are:
x1 = 3.06 and x2 = as it is 3.125
Find new x3 between x1 = 3.06 and x2 = 3.125
X3 = (3.06 + 3.125) / 2 = 3.09
Bisection method
3 2
𝑓 𝑥 = 𝑥 − 𝑥 − 20
Step 3: Find f (x3) and check the sign.
x3 = 3.09 hence f(x3) = -0.04 (Negative)

Hence we have to replace x1 with x3

Therefore new initial guesses are:


x1 = 3.09 and x2 = as it is 3.125
Find new x3 between x1 = 3.09 and x2 = 3.125
X3 = (3.09 + 3.125) / 2 = 3.10

Find f (x3) and check the sign.


x3 = 3.10 hence f(x3) = 0.18 (Positive)

Hence again replace x2 with x3


Therefore new initial guesses are:
x1 = 3.09 as it is and x2 = 3.10
Find new x3 between x1 = 3.09 and x2 = 3.10
X3 = (3.09 + 3.10) / 2 = 3.095
Bisection method
3 2
𝑓 𝑥 = 𝑥 − 𝑥 − 20
Step 3: Find f (x3) and check the sign.
x3 = 3.095 hence f(x3) = 0.06 (Positive)

Which is almost near to zero. Hence we can stop.

You might also like