3.03 Bisection Methods for Solving a Nonlinear Equation
3.03 Bisection Methods for Solving a Nonlinear Equation
Introduction
One of the first numerical methods developed to find the root of a nonlinear equation f (x) = 0 was the bisection method (also
called the binary-search method). The procedure is based on the following theorem.
Theorem
An equationf (x) = 0 , where f (x) is a real continuous function, has at least one root between xl and xu if f (xl )f (xu ) < 0 (See
Figure 3.3.1.1).
Note that if f (xl )f (xu ) > 0 , there may or may not be any root between x and x (Figures 3.3.1.2 and 3.3.1.3). If
l u
f (xl )f (xu ) < 0 , then there may be more than one root between x and x (Figure 3.3.1.4). So the theorem only guarantees one
l u
Since the method is based on finding the root between two points, the technique falls under bracketing methods.
Since the root is bracketed between two points, xl and xu , one can find the midpoint xm between xl and xu . We hence get two
new intervals x and x , and x and x .
l m m u
Figure 3.3.1.1 . At least one root exists between the two points if the function is real, continuous, and changes sign.
Figure 3.3.1.2 . If the function f (x) does not change the sign between the two points, roots of the equation f (x) = 0 may still exist
between the two points.
3.03.1 https://math.libretexts.org/@go/page/126400
Figure 3.3.1.3. If the function f (x) does not change the sign between two points, there may not be any roots for the equation
f (x) = 0 between the two points.
Figure 3.3.1.4 . If the function f (x) changes the sign between the two points, more than one root for the equation f (x) = 0 may
exist between the two points.
Is the root now between x and x or between x and x ? Well, one can find the sign of f (x )f (x ), and if f (x )f (x ) < 0
l m m u l m l m
then the new bracket is between x and x ; otherwise, it is between x and x . So, you can see that you are halving the interval.
l m m u
As one repeats this process, the width of the interval [x , x ] becomes smaller and smaller, and you can zero on to the root of the
l u
equation f (x) = 0 .
Audiovisual Lectures
Title: Bisection Method - Introduction
Summary: Learn what the bisection method of solving nonlinear equations is based on.
3.03.2 https://math.libretexts.org/@go/page/126400
What is the bisection method, and what is it based on?
One of the first numerical methods developed to find the root of a nonlinear equation f (x) = 0 was the bisection method (also
called the binary-search method). The procedure is based on the following theorem.
Theorem
An equationf (x) = 0 , where f (x) is a real continuous function, has at least one root between xl and xu if f (xl )f (xu ) < 0
Figure 3.3.2.1 . At least one root exists between the two points if the function is real, continuous, and changes sign.
Bisection method
Since the method is based on finding the root between two points, the technique falls under the category of bracketing methods.
Since the root is bracketed between two points, xl and x , one can find the mid-point,
u xm between x andl xu . This gives us two
new intervals x and x , and x and x .
l m m u
Is the root now between x and x or between x and x ? Well, one can find the sign of f (x )f (x ), and if f (x )f (x ) < 0
l m m u l m l m
then the new bracket is between x and x , otherwise, it is between x and x . So, you can see that you are literally halving the
l m m u
interval. As one repeats this process, the width of the interval [x , x ] becomes smaller and smaller, and you can zero into the root
l u
of the equation f (x) = 0 . The algorithm for the bisection method is given as follows.
Estimate the root x of the equation f (x) = 0 as the mid-point between x and x as
m l u
xl + xu
xm =
2
where
new
xm = estimated root from the present iteration
3.03.3 https://math.libretexts.org/@go/page/126400
old
xm = estimated root from the previous iteration
Compare the absolute relative approximate error |∈ | with the pre-specified relative error tolerance ∈ . If |∈ | >∈ , then go to
a s a s
Step 3, else stop the algorithm. Note one should also check whether the number of iterations is more than the maximum number of
iterations allowed. If so, one needs to terminate the algorithm and notify the user about it.
Audiovisual Lectures
Title: Bisection Method - Algorithm
Summary: Learn the algorithm of the bisection method of solving nonlinear equations of the form f (x) = 0 .
Applications
In the previous lesson, you learned the theory of the bisection method of solving a nonlinear equation. In this lesson, we apply the
algorithm of the bisection method to solve a nonlinear equation.
Example 3.3.3.1
Use the bisection method to find the root of the nonlinear equation
3
x = 20
Solution
Rewrite the equation x 3
= 20 in the form f (x) = 0 that gives
3
f (x) = x − 20 = 0
Check if the function changes the sign between the two initial guesses, x and x . The initial guesses are given as x
l u l =1 and
xu = 4
3.03.4 https://math.libretexts.org/@go/page/126400
f (xl ) = f (1)
3
=1 − 20
= −19
f (xu ) = f (4)
3
=4 − 20
= 44
Hence
= (−19)(44) < 0
This change in sign tells us that the initial bracket of [1, 4] given to us is valid.
Iteration 1
xl = 1, xu = 4
= 2.5
Iteration 2
Find the value of the function at the midpoint from the previous iteration and use it to determine the new bracket.
f (xm ) = f (2.5)
3
= (2.5 ) − 20
= −4.375
= (−19)(−4.375) > 0
Since f (x )f (x
l m) >0 , the root does not lie between x and x , but between x and x , that is, 2.5 and 4.
l m m u
xl = 2.5, xu = 4
= 3.25
∣ xnew
m
old
− xm ∣
| εa | = ∣ ∣ × 100
new
∣ xm ∣
∣ 3.25 − 2.5 ∣
=∣ ∣ × 100
∣ 3.25 ∣
= 23.1%
None of the significant digits are at least correct in the estimated root of the equation because the absolute relative
approximate error is greater than 5%.
Iteration 3
Find the value of the function at the midpoint from the previous iteration and use it to determine the new bracket.
3.03.5 https://math.libretexts.org/@go/page/126400
f (xm ) = f (3.25)
3
= (3.25 ) − 20
= 14.3281
= (−4.375)(14.3281) < 0
Since f (x )f (x
l m) <0 , the root does lie between x and x , that is, 2.5 and 3.25.
l m
xl = 2.5, xu = 3.25
= 2.875
∣ xnew
m
old
− xm ∣
| ϵa | = ∣ ∣ × 100
new
∣ xm ∣
∣ 2.875 − 2.5 ∣
=∣ ∣ × 100
∣ 2.875 ∣
= 13.0%
Still, none of the significant digits are at least correct in the estimated root of the equation as the absolute relative
approximate error is greater than 5%.
Example 3.3.3.2
You are working for ‘DOWN THE TOILET COMPANY’ that makes floats for ABC commodes. The floating ball has a
specific gravity of 0.6 and has a radius of 5.5 cm. You are asked to find the depth to which the ball is submerged when floating
in the water.
The equation that gives the depth x to which the ball is submerged underwater is given by
3 2 −4
x − 0.165 x + 3.993 × 10 =0
Use the bisection method of finding roots of equations to find the depth x to which the ball is submerged underwater. Conduct
three iterations to estimate the root of the above equation. Find the absolute relative approximate error at the end of each
iteration, and the number of significant digits at least correct at the end of each iteration.
Solution
From the physics of the problem, the ball would be submerged somewhere between x = 0 and x = 2R ,
where
that is
0 ≤ x ≤ 2R
0 ≤ x ≤ 2(0.055)
0 ≤ x ≤ 0.11
3.03.6 https://math.libretexts.org/@go/page/126400
Figure 3.3.3.1 . Floating ball problem.
Let’s us assume
xl = 0, xu = 0.11
f (xl ) = f (0)
3 2 −4
= (0 ) − 0.165(0 ) + 3.993 × 10
−4
= 3.993 × 10
f (xu ) = f (0.11)
3 2 −4
= (0.11 ) − 0.165(0.11 ) + 3.993 × 10
−4
= −2.662 × 10
Hence
f (xl )f (xu ) = f (0)f (0.11)
−4 −4
= (3.993 × 10 )(−2.662 × 10 )
<0
So, there is at least one root between x and x , that is between 0 and 0.11.
l u
Iteration 1
The estimate of the root is
xl + xu
xm =
2
0 + 0.11
=
2
= 0.055
f (xm ) = f (0.055)
3 2 −4
= (0.055 ) − 0.165(0.055 ) + 3.993 × 10
−5
= 6.655 × 10
−4 −4
= (3.993 × 10 ) (6.655 × 10 )
>0
xl = 0.055, xu = 0.11
At this point, the absolute relative approximate error | ϵa | cannot be calculated as we do not have a previous
approximation.
Iteration 2
3.03.7 https://math.libretexts.org/@go/page/126400
The estimate of the root is
xl + xu
xm =
2
0.055 + 0.11
=
2
= 0.0825
f (xm ) = f (0.0825)
3 2 −4
= (0.0825 ) − 0.165(0.0825 ) + 3.993 × 1 0
−4
= −1.622 × 10
−5 −4
= (6.655 × 10 ) × (−1.622 × 10 )
<0
Hence, the root is bracketed between x and x , that is, between 0.055 and 0.0825. So, the lower and upper limit of the
l m
new bracket is
xl = 0.055, xu = 0.0825
∣ xnew − xold ∣
m m
| ϵa | = ∣ ∣ × 100
new
∣ x m ∣
∣ 0.0825 − 0.055 ∣
=∣ ∣ × 100
∣ 0.0825 ∣
= 33.33%
None of the significant digits are at least correct in the estimated root of xm = 0.0825 because the absolute relative
approximate error is greater than 5%.
Iteration 3
xl + xu
xm =
2
0.055 + 0.0825
=
2
= 0.06875
f (xm ) = f (0.06875)
3 2 −4
= (0.06875 ) − 0.165(0.06875 ) + 3.993 × 1 0
−5
= −5.563 × 10
<0
Hence, the root is bracketed between x and x , that is, between 0.055 and 0.06875. So the lower and upper limit of the
l m
new bracket is
xl = 0.055, xu = 0.06875
new old
∣ xm − xm ∣
| ϵa | = ∣ ∣ × 100
new
∣ xm ∣
∣ 0.06875 − 0.0825∣
=∣ ∣ × 100
∣ 0.06875 ∣
= 20%
3.03.8 https://math.libretexts.org/@go/page/126400
Still, none of the significant digits are at least correct in the estimated root of the equation as the absolute relative
approximate error is greater than 5%.
Seven more iterations were conducted, and these iterations are shown in Table 3.3.3.1.
Table 3.3.3.1 . Root of f (x) = 0 as function of number of iterations for bisection method.
Iteration xl xu xm |ϵa | % f (xm )
−5
1 0.00000 0.11 0.055 −−− 6.655 × 10
−4
2 0.055 0.11 0.0825 33.33 −1.622 × 10
−5
3 0.055 0.0825 0.06875 20.00 −5.563 × 10
−6
4 0.055 0.06875 0.06188 11.11 4.484 × 10
−5
5 0.06188 0.06875 0.06531 5.263 −2.593 × 10
−5
6 0.06188 0.06531 0.06359 2.702 −1.0804 × 10
−6
7 0.06188 0.06359 0.06273 1.370 −3.176 × 10
−7
8 0.06188 0.06273 0.0623 0.6897 6.497 × 10
−6
9 0.0623 0.06273 0.06252 0.3436 −1.265 × 10
−7
10 0.0623 0.06252 0.06241 0.1721 −3.0768 × 10
Hence the number of significant digits at least correct is given by the largest value of m for which
2−m
| ϵa | ≤ 0.5 × 10
2−m
0.1721 ≤ 0.5 × 10
2−m
0.3442 ≤ 10
log(0.3442) ≤ 2 − m
m ≤ 2 − log(0.3442) = 2.463
So
m =2
The number of significant digits at least correct in the estimated root of 0.06241 at the end of the 10 th
iteration is 2.
3.03.9 https://math.libretexts.org/@go/page/126400
Lesson 4: Advantages and Pitfalls of Bisection Method
Learning Objectives
After successful completion of this lesson, you should be able to
1) enumerate the advantages of the bisection method and the reasoning behind them.
2) list the drawbacks of the bisection method and the reason behind them.
it will be unable to find the lower guess, x , and upper guess, x , such that
l u
d) For functions f (x) where there is a singularity, and it reverses the sign at the singularity, the bisection method may converge on
the singularity (Figure 3.3.4.2). An example includes
1
f (x) =
x
where x l = −2 ,x
u =3 are valid initial guesses which satisfy
However, the function is not continuous, and the theorem that a root exists is also not applicable.
3.03.10 https://math.libretexts.org/@go/page/126400
1
Figure 3.3.4.2 . The equation f (x) = = 0 has no root but changes sign.
x
Audiovisual Lecture
Title: Bisection Method: Advantages and Drawbacks
Summary: This video discusses the advantages and drawbacks of the bisection method - a numerical method to find roots of a
nonlinear equation.
3.03.11 https://math.libretexts.org/@go/page/126400
(3). Assuming an initial bracket of [1, 5], the second (at the end of 2 iterations) iterative value of the root of te −t
− 0.3 = 0 using
the bisection method is
(A) 0
(B) 1.5
(C) 2
(D) 3
(4). To find the root of f (x) = 0 , a scientist is using the bisection method. At the beginning of an iteration, the lower and upper
guesses of the root are x and x . At the end of the iteration, the absolute relative approximate error in the estimated value of the
l u
root would be
∣ xu ∣
(A) ∣ ∣
∣ xu + xl ∣
∣ xl ∣
(B) ∣ ∣
∣ xu + xl ∣
∣ xu − xl ∣
(C) ∣ ∣
∣ xu + xl ∣
∣ xu + xl ∣
(D) ∣ ∣
∣ xu − xl ∣
(5). For an equation like x = 0 , a root exists at x = 0 . The bisection method cannot be adopted to solve this equation in spite of
2
(A) is a polynomial
(B) has repeated zeros at x = 0
(C) is always non-negative
(D) has a slope equal to zero at x = 0
(6). The ideal gas law is given by
pv = RT
where p is the pressure, v is the specific volume, R is the universal gas constant, and T is the absolute temperature. This equation
is only accurate for a limited range of pressure and temperature. Vander Waals came up with an equation that was accurate for
larger ranges of pressure and temperature given by
a
(p + ) (v − b) = RT
2
v
where a and b are empirical constants dependent on a particular gas. Given the value of R = 0.08 , a = 3.592, b = 0.04267,
p = 10 and T = 300 (assume all units are consistent), one is going to find the specific volume, v , for the above values. Without
finding the solution from the Vander Waals equation, what would be a good initial guess for v ?
(A) 0
(B) 1.2
(C) 2.4
(D) 3.6
For complete solution, go to
http://nm.mathforcollege.com/mcquizzes/03nle/quiz_03nle_bisection_solution.pdf
Problem Set
(1). Find the estimate of the root of x − 4 = 0 by using the bisection method. Use initial guesses of 1.7 and 2.4. Conduct three
2
iterations, and calculate the approximate error, true error, absolute relative approximate error, and absolute relative true error at the
3.03.12 https://math.libretexts.org/@go/page/126400
end of each iteration.
Answer
Iteration # Root Estimate Approx Error True Error Abs Rel Approx Error Abs Rel True Error
(2). You are working for DOWN THE TOILET COMPANY that makes floats for ABC commodes. The ball has a specific gravity
of 0.6 and has a radius of 5.5 cm. You are asked to find the depth to which the ball will get submerged when floating in the water.
The equation that gives the depth x (unit of x is meters) to which the ball is submerged under water is given by
3 2 −4
x − 0.165 x + 3.993 × 10 =0
Solving it exactly would require some effort. However, using numerical techniques such as the bisection method, we can solve this
equation and any other equation of the form f (x) = 0 . Solve the above equation by the bisection method and do the following. Use
initial guesses of x = 0 and x = 0.11.
a) Conduct three iterations.
b) Calculate the absolute relative approximate error at the end of each step.
c) Find the number of significant digits at least correct at the end of each iteration.
d) How can you use the knowledge of the physics of the problem to develop initial guesses for the bisection method?
Answer
a) 0.055, 0.0825, 0.06875
c) n/a, 0, 0
d) Since the diameter is 0.11 m, initial guesses of 0 and 0.11 are reasonable starting values
−t
1
v(t) = te +
t
where
t is given in seconds and v is given in m/s.
Find the time when the velocity of the body will be 0.35 m/s. Use bisection method and conduct three iterations. Use initial
bracketing guess of [1, 8]. Show all steps in calculating the estimated root, absolute relative approximate error and the velocity of
the body for each iteration. Also, tabulate your answers as iteration number, estimated root, absolute relative approximate error, and
velocity of the body.
3.03.13 https://math.libretexts.org/@go/page/126400
Answer
Iteration Estimated Root |ϵa |% v(t) (m/s)
1 4.500 − 0.27221
(4). Enumerate the drawbacks of the bisection method of solving nonlinear equations.
(5). The velocity of a body is given by
−t
v = 5e + 4 + sin(t),
where
v is given in m/s,
t is given in s.
Derive the nonlinear equation that you will need to solve to find when the acceleration of the body would be 1.54 m/s . Find the 2
Answer
The equation has no real roots. Note the question asks when acceleration is 1.54 m/s 2
(6). To solve the equation f (x) = 0 , an engineer is using the bisection method. He starts with an initial valid bracket of [2, 7]. Find
the maximum possible absolute true error in his estimate of the root at the end of two iterations. Show your reasoning clearly for
your answer.
Answer
1.25
(7). Estimate the next guess for the root of x − 16 = 0 by using a modified bisection method as explained below. The initial
2
bracket of [1, 8] is found as a valid bracket. In the case of bisection method, the root estimated at the end of the first iteration is the
midpoint between 1 and 8. Instead, in the modified bisection method, the root estimated at the end of the first iteration would be
the point where the straight line drawn from the function at x = 1 to the function at x = 8 crosses the x -axis. What is this estimate
of the root?
Answer
2.667
This page titled 3.03: Bisection Methods for Solving a Nonlinear Equation is shared under a CC BY-NC-SA 4.0 license and was authored,
remixed, and/or curated by Autar Kaw via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit
history is available upon request.
3.03.14 https://math.libretexts.org/@go/page/126400