Week 02 - Lecture Notes
Week 02 - Lecture Notes
Week 02
by
Dr. Sajjad A. Ghauri
Bisection Method
The first technique, based on the Intermediate Value Theorem, is called the Bisection, or
Binary-search, method.
Suppose f (x) is a continuous function defined on the interval [a, b], with f (a) and f (b) of
opposite sign. The Intermediate Value Theorem implies that a number p exists in (a, b) with
f (p) = 0. Although the procedure will work when there is more than one root in the interval
(a, b), we assume for simplicity that the root in this interval is unique. The method calls for
a repeated halving (or bisecting) of subintervals of [a, b] and, at each step, locating the half
containing p. To begin, set a1 = a and b1 = b, and let p1 be the midpoint of [a, b], that is,
b 1 − a1 a1 + b 1
p 1 = a1 + = .
2 2
If f (p1 ) ̸= 0, then f (p1 ) has the same sign as either f (a1 ) or f (b1 ).
If f (p1 ) and f (a1 ) have the same sign, p ∈ (p1 , b1 ). Set a2 = p1 and b2 = b1 .
This process is repeated with new points until root is determined sufficient accuracy.
1
Example 1: Find the root of the following equation by bisection method.
x3 − x − 1 =0,
Here f (x) = x3 − x − 1.
f (2) =23 − 2 − 1 = 5,
1st iteration: Here f (1) = −1 < 0 and f (2) = 5 > 0. Now, Root lies between 1 and 2.
1+2
x0 =
2
x0 =1.5
2nd iteration: Here f (1) = −1 < 0 and f (1.5) = 0.875 > 0. Now, Root lies between 1 and
1.5
1 + 1.5
x1 =
2
x1 =1.25
3rd iteration: Here f (1.25) = −0.2969 < 0 and f (1.5) = 0.875 > 0. Now, Root lies
between 1.25 and 1.5
1.25 + 1.5
x2 =
2
x2 =1.375
Similarly, we have
2
a+b
n a f (a) b f (b) c= 2
f (c) Update
1 1 -1 2 5 1.5 0.875 b=c
2 1 -1 1.5 0.875 1.25 -0.2969 a=c
3 1.25 -0.2969 1.5 0.875 1.375 0.2246 b=c
4 1.25 -0.2969 1.375 0.2246 1.3125 -0.0515 a=c
5 1.3125 -0.0515 1.375 0.2246 1.3438 0.0826 b=c
6 1.3125 -0.0515 1.3438 0.0826 1.3281 0.0146 b=c
7 1.3125 -0.0515 1.3281 0.0146 1.3203 -0.0187 a=c
8 1.3203 -0.0187 1.3281 0.0146 1.3242 -0.0021 a=c
9 1.3242 -0.0021 1.3281 0.0146 1.3262 0.0062 b=c
10 1.3242 -0.0021 1.3262 0.0062 1.3252 0.002 b=c
11 1.3242 -0.0021 1.3252 0.002 1.3247 0 a=c
Example 2: Find the root of the following equation by bisection method between [1, 2].
x
sin x − =0,
2
1st iteration: Here f (1) = 0.3415 > 0 and f (2) = −0.0907 < 0. Now, Root lies between 1
and 2.
1+2
x0 =
2
x0 =1.5
1.5
f (x0 ) =f (1.5) = sin(1.5) − = 0.2475 > 0
2
2nd iteration: Here f (1.5) = 0.2475 > 0 and f (2) = −0.0907 < 0. Now, Root lies between
3
1.5 and 2
1.5 + 2
x1 =
2
x1 =1.75
3rd iteration: Here f (1.75) = 0.109 > 0 and f (2) = −0.0907 < 0. Now, Root lies between
1.75 and 2
1.75 + 2
x2 =
2
x2 =1.875
Similarly, we have
a+b
n a f (a) b f (b) c= 2
f (c) Update
1 1 0.3415 2 -0.0907 1.5 0.2475 a=c
2 1.5 0.2475 2 -0.0907 1.75 0.109 a=c
3 1.75 0.109 2 -0.0907 1.875 0.0166 a=c
4 1.875 0.0166 2 -0.0907 1.9375 -0.0352 b=c
5 1.875 0.0166 1.9375 -0.0352 1.9062 -0.0089 b=c
6 1.875 0.0166 1.9062 -0.0089 1.8906 0.004 a=c
7 1.8906 0.004 1.9062 -0.0089 1.8984 -0.0024 b=c
8 1.8906 0.004 1.8984 -0.0024 1.8945 0.0008 a=c
9 1.8945 0.0008 1.8984 -0.0024 1.8965 -0.0008 b=c
10 1.8945 0.0008 1.8965 -0.0008 1.8955 0 b=c
Approximate root of the equation sin x − x2 = 0 using Bisection method is 1.8955 (correct to
4 dp) (After 10 iterations).
Exercise 1: Find the root of the following equation by bisection method correct to four
dp upto four stages.
x3 − 4x − 9 =0,
4
Exercise 2: Find the root of the following equation by bisection method correct to three
dp upto five stages.
Bisection Method: The bisection Method is one of the simplest, most reliable, easy
to implement, and convergence-guaranteed methods for finding the real root of non-linear
equations. It is also known as Binary Search or Half Interval or Bolzano Method.
The bisection method is a bracketing method and starts with two initial guesses say x0 and
x1 such that x0 and x1 brackets the root i.e., f (x0 )f (x1 ) < 0.
The bisection method is based on the fact that if f (x) is a real and continuous function,
and for two initial guesses x0 and x1 brackets the root such that, f (x0 )f (x1 ) < 0 then there
exists at least one root between x0 and x1 . The root is obtained in the Bisection method by
successive halving the interval i.e. If x0 and x1 are two guesses, then we compute the new
x0 +x1
approximated root as, x2 = 2
. Now we have the following three different cases,
And then the process is repeated until we find the root within the desired accuracy.
1. Start
x0 +x1
5. Calculate new approximated root as x2 = 2
5
6. Calculate f (x0 )f (x2 )
8. Display x2 as root.
9. Stop
In Numerical analysis (methods), Bisection method is one of the simplest, convergence guar-
anteed method to find real root of non-linear equations.
3. Does not involve complex calculations: The bisection method does not require any
complex calculations. To perform the Bisection method, all we need is to calculate the
average of two numbers.
4. Guaranteed error bound: In this method, there is a guaranteed error bound, and it
1
decreases with each successive iteration. The error bound decreases by 2
with each
iteration.
6
Demerits of Bisection Method: In Numerical analysis (methods), the Bisection
method has a slow rate of convergence. The bisection method has the following demerits.
1. Slow Rate of Convergence: Although the convergence of the Bisection method is guar-
anteed, it is generally slow.
2. Choosing one guess close to the root has no advantage: Choosing one guess close to
the root may result in requiring many iterations to converge.
3. Cannot find the root of some equations. For example: f (x) = x2 as there are no
bracketing values.
7. It cannot be applied over an interval where the function takes values of the same sign.