Continuity Bisection Method
Continuity Bisection Method
Quick Overview
• The bisection algorithm approximates the location of an x-intercept (a
root) of a continuous function.
• The bisection algorithm depends on the Intermediate Value Theorem.
• The algorithm is iterative. This means that the result from using it once
will help us get a better result when we use the algorithm a second time.
Basic Idea
Suppose f (x) is continuous over [a, b], and f (a) and f (b) have opposite signs
(see the image below). Then, the Intermediate Value Theorem tells us that the
function will achieve every value between f (a) and f (b) at least once somewhere
in [a, b].
Since f (a) and f (b) have opposite signs, then we know 0 is somewhere in-
between. So the IVT guarantees that somewhere in [a, b] the function will equal
0 (again, see the image below).
We approximate the location of the root by finding the midpoint of the
interval at x = a+b
2 (see image below).
www.mathwarehouse.com
a+b
a 2
The Algorithm
Suppose f (x) is continuous over [a, b] and the function values at the end-
points have different signs.
© http://www.mathwarehouse.com
1. Find the midpoint of [a, b]. Call it x1 .
(a) If f (x1 ) = 0, we’re done.
(b) If not, then x1 is our first approximation to the root of the function.
It has a maximum error of 21 the length of the interval.
2. Find a smaller interval where f (x) has opposite signs at the endpoints.
This new interval will either be [a, x1 ], or [x1 , b].
3. Using this smaller interval, repeat Steps 1 and 2 until the error is small
enough.
Example 1
Using the Bisection Algorithm, find three approximations of the root of
f (x) = 14 x2 − 3. Determine the maximum error possible in using each approxi-
mation.
Solution
Step 1) Verify the Bisection Algorithm can be used.
We first note that the function is continuous everywhere on it’s domain.
Next, we pick an interval to work with. If we pick x = 2, we see that
f (0) = −2 < 0 and if we pick x = 4 we see f (4) = 1 > 0. So we can start with
the interval [2, 4].
y
www.mathwarehouse.com
2 4 x
−2
Step 2) Find the first approximation to the root and its associated error.
The first approximation to the root is the midpoint of our starting interval.
In this case, the midpoint of [2, 4] is at x = 3.
© http://www.mathwarehouse.com
y
www.mathwarehouse.com
1
2 3 4 x
−2
Step 3) Use the midpoint to find a smaller interval so we can improve our
approximation.
Notice that f (3) = 14 (3)2 − 3 = − 43 < 0. Updating our graph, we now have
three points on it.
y
www.mathwarehouse.com
1
2 3 4
x
−2
Examining this graph, we see that the root must lie between x = 3 and
x = 4. Consequently, this is our new interval.
© http://www.mathwarehouse.com
Max Error: Our interval has a length of 1 unit, so the maximum possible
error in using x = 27 as an approximation will be ±1/2 of a unit.
Our graph now looks like this:
y
www.mathwarehouse.com
1 7
3 2 4
x
−2
1 7
3 2 4
x
−2
Examining this graph, we see that the root must lie between x = 3 and
x = 72 . This becomes our next interval.
© http://www.mathwarehouse.com
y
www.mathwarehouse.com
1 7
3 2
x
13
4
−2
Answer The table below summarizes the approximations we found and their
associated errors.
Example 2
Use the bisection algorithm to approximate the solution to the equation
below to within less than 0.1 of its real value. Assume x is in radians.
sin x = 6 − x
Solution
Step 1) Rewrite the equation so it is equal to 0.
x − 6 + sin x = 0
The function we’ll work with is f (x) = x−6+sin x. Notice that the function
is continuous everywhere.
© http://www.mathwarehouse.com
x f (x)
0 f (0) = −6
1 f (1) ≈ −4.2
2 f (2) ≈ −3.1
3 f (3) ≈ −2.9
4 f (4) ≈ −2.8
5 f (5) ≈ −2
6 f (6) ≈ −0.3
7 f (7) ≈ 1.7
The first time we see a positive function value is at x = 7. So, we can use
[6, 7] as the initial interval.
Step 4) Find the 2nd interval. Use this new interval to determine the 2nd
approximation. The first line of the table is included for completeness. The
new work is on the second line.
Step 5) Repeat Step 4 until the associated error is less than 0.1 units.
© http://www.mathwarehouse.com
Finding the 3rd Approximation
Finding the New Interval Next Approximation
f (left) f (mid) f (right) New Interval Midpoint Max Error
Starting Interval: [6, 7] 6.5 ±0.5
f (6) ≈ −0.28 f (6.5) ≈ 0.72 f (7) ≈ 1.66 [6, 6.5] 6.25 ±0.25
f (6) ≈ −0.28 f (6.25) ≈ 0.22 f (6.5) ≈ 0.72 [6, 6.25] 6.125 ±0.125
Example 3
Find the √third approximation from the bisection algorithm to approximate
the value of 3 2.
Solution
√
3
Step 1) Find (make) a non-linear function with a root at 2.
© http://www.mathwarehouse.com
√
We are interested in knowing the approximate value of x = 3 2. We use this
equation to build a non-linear function with a root at the appropriate value.
√
3
x= 2
3
x =2
3
x −2=0
We’ll use the function f (x) = x3 − 2. Notice that the function is continuous
everywhere.
Step 3) Setup and work through the table as in the previous example. The
approximations are in blue. The new intervals are in red.
√
Answer 3
2 ≈ 1.25 with a possible error of ±0.25. √(Even with only 3 approxi-
mations, we’re pretty close! The calculator tells us 3 2 ≈ 1.25992)
© http://www.mathwarehouse.com
Example 4
The function f (x) = x4 − 5 has a positive root that is less than 3. If we
started the bisection algorithm with the interval [0, 3], how many iterations
would it take before our approximation is within 10−4 of the actual value?
Solution
Step 1) Solve 0.5n (b − a) = 0.01 for n when a = 0 and b = 3.
0.5n (3 − 0) = 10−4
0.5n (3) = 10−4
10−4
0.5n =
3
1
n ln(0.5) = ln
30000
−n ln 2 = − ln(30000)
ln 30000
n=
ln 2
≈ 14.87
© http://www.mathwarehouse.com
Questions
Question 1 Find the 4th approximation of the positive root of the function
f (x) = x4 − 7 using the bisection algorithm.
Question
√ 2 Find the third approximation of the root of the function f (x) =
1 3
2x − x + 1 using the bisection algorithm.
Question 4 Approximate the value of the root of f (x) = −3x3 + 5x2 + 14x − 16
near x = 3 to within 0.05 of its actual value.
Question 5 Find the 4th approximation to the solution of the equation below
using the bisection algorithm.
x2 − x − 2 = x
Question 6 Find the 5th approximation to the solution to the equation below,
using the bisection algorithm.
x4 − 2 = x + 1
Question 7 The equation below should have a solution that is larger than 5.
Use the bisection algorithm to approximate this solution to within 0.1 of its
actual value.
x3 + 18x − 6 = 9x2 − 2x + 7
Question 8 The only real solution to the equation below is negative. Approx-
imate the value of this solution to within 0.05 units of its actual value.
x3 + 7x2 − 2 = 2x2 − 7x − 7
√
Question 9 Use the bisection algorithm to approximate the value of 71. Find
the 4th approximation.
1
Question 10 Use the bisection algorithm to approximate the value of 5 .
√
3
Find
the 3rd approximation.
√
Question 11 Use the bisection algorithm to approximate the value of 125 to
within 0.125 units of the actual value.
√
4
12500
Question 12 Use the bisection algorithm to approximate the value of 2
to within 0.1 units of the actual value.
© http://www.mathwarehouse.com
Question 13 Suppose we used the bisection method on f (x), with an initial
interval of [2, 5]. How many iterations would it take before the maximum error
would be less than 0.01 units?
© http://www.mathwarehouse.com
Answers
Question 1 Solution
Step 1) Since the function is continuous everywhere, find an appropriate starting
interval.
Then, notice that f (1) = −6 < 0, but f (2) = 9 > 0. Let’s use [1, 2] as the
starting interval.
Step 2) Set up and use the table of values as in the examples above. The
approximations are in blue, the new intervals are in red.
Question 2 Solution
Step 1) Since the function is continuous everywhere, determine an appropriate
starting interval.
Set up a table of values to help us find an appropriate interval.
x f (x)
0 f (0) = −1
1 f (1) ≈ −0.8
2 f (2) ≈ −0.4
3 f (3) ≈ −0.1
4 f (4) ≈ 0.3
This table indicates the root is between x = 3 and x = 4, so a good starting
interval is [3, 4]
© http://www.mathwarehouse.com
Finding the New Interval Next Approximation
Question 3 Solution
Step 1) Since the function is continuous everywhere, determine an appropriate
starting interval.
At x = −2 the function value is f (−2) = −3, and at x = −3 the function
value is f (−3) = 2. We’ll use [−3, −2] as the starting interval.
Step 2) Determine the first approximation and the maximum possible error in
using it.
Step 3) Determine the second interval, second approximation and the associated
maximum error.
Step 4) Repeat Step 3 with the new interval. Continue to repeat until the
maximum error is less than 0.1.
© http://www.mathwarehouse.com
Finding the 3rd Interval
x f (x)
Current left-endpoint −3 f (−3) = 2
Midpoint −2.75 f (−2.75) ≈ 0.6
Current right-endpoint −2.5 f (−2.5) ≈ −0.8
Question 4 Solution
Step 1) Determine an appropriate starting interval, the first approximation and
its associated maximum error value.
First, notice that the function is continuous everywhere. Then, since we’re
told that the root is near x = 3 we can check that f (3) = −10.
Checking x = 4 we find that f (4) = −72, but at x = 2 the function value is
f (2) = 8.
© http://www.mathwarehouse.com
Step 2) Determine the second interval, the second approximation and the asso-
ciated maximum error.
Step 3) Repeat Step 2 until the maximum possible error is less than 0.05 units.
© http://www.mathwarehouse.com
5th interval: [2.625, 2.6875].
5th approximation: The midpoint is x = 2.65625
Associated error: ±0.03125 units.
Question 5 Solution
Step 1) Identify the function by getting the equation equal to zero.
x2 − 2x − 2 = 0
The function we’ll use is f (x) = x2 − 2x − 2.
Step 3) Determine the second interval, second approximation and its associated
maximum error.
© http://www.mathwarehouse.com
Step 4) Repeat Step 3 twice to complete the iterations of the bisection method
for this question.
Question 6 Solution
Step 1) Identify the function we will use by rewriting the equation so it is set
equal to zero.
x4 − x − 3 = 0
The function we will use is f (x) = x4 − x − 3.
Step 2) Identify the first interval, the first approximation and its associated
maximum error.
Notice that at x = 0 the function value is f (0) = −3.
Also, at x = 2 the function value is f (2) = 11.
© http://www.mathwarehouse.com
1st Interval: [0, 2]
1st Approximation: x = 1
Associated Error: ±1 unit
© http://www.mathwarehouse.com
Finding the 5th Interval
x f (x)
Current left-endpoint 1.25 f (1.25) ≈ −1.8
Midpoint 1.375 f (1.375) ≈ −0.8
Current right-endpoint 1.5 f (1.5) ≈ 0.6
Question 7 Solution
Step 1) Identify the function we’ll use by rewriting the equation so it is equal
to zero.
x3 − 9x2 + 20x − 13 = 0
The function is f (x) = x3 − 9x2 + 20x − 13.
Step 2) Determine the first interval, 1st approximation, and its associated error.
We know the solution is larger than 5, but we don’t know how much larger.
We set up a small table of values to help us out.
x f (x)
5 −13
6 −1
7 29
From this table we can select the first interval and determine the first ap-
proximation.
1st Interval: [6, 7]
Step 3) Find the second interval, second approximation and the associated error.
© http://www.mathwarehouse.com
Finding the 2nd Interval
x f (x)
Current left-endpoint 6 f (6) = −1
Midpoint 6.5 f (6.5) ≈ 11.4
Current right-endpoint 7 f (7) = 29
Step 4) Repeat Step 3 until the maximum error is less than the given tolerance
of 0.1.
Finding the 3rd Interval
x f (x)
Current left-endpoint 6 f (6) = −1
Midpoint 6.25 f (6.25) ≈ 4.6
Current right-endpoint 6.5 f (6.5) ≈ 11.4
Question 8 Solution
© http://www.mathwarehouse.com
Step 1) Rewrite the equation so we can identify the function we are working
with.
x3 + 5x2 + 7x + 5 = 0
So, f (x) = x3 + 5x2 + 7x + 5
Step 2) Identify the first interval, the first approximation, and the associated
error.
We know the solution is negative, but that is all. Let’s set up a table of
values to get an idea of where our first interval should be.
x f (x)
−1 2
−2 3
−3 2
−4 −7
Step 3) Identify the 2nd interval, 2nd approximation and the associated maxi-
mum error.
Finding the 2nd Interval
x f (x)
Current left-endpoint −4 f (−4) = −7
Midpoint −3.5 f (−3.5) ≈ −1.1
Current right-endpoint −3 f (−3) = 2
Step 4) Repeat Step 3 until the maximum error is less 0.05 units.
© http://www.mathwarehouse.com
3rd Interval: [−3.5, −3.25]
3rd Approximation: x = −3.375
Associated Error: ±0.125
Question 9 Solution
√
Step 1) Find a non-linear function whose root is at 7.
√
x= 71
2
x = 71
2
x − 71 = 0
© http://www.mathwarehouse.com
We’ll use f (x) = x2 − 71.
Step 2) Find the first interval, first approximation and its associated maximum
error.
√
We know 71 is larger than 8, but less than 9. We’ll use [8, 9] as the first
interval.
• 1st Interval: [8, 9]
• 1st Approximation: x = 8.5
• Associated Error: ±0.5 units
Step 3) Find the second interval, second approximation and the associated max-
imum error.
© http://www.mathwarehouse.com
4th Interval: [8.375, 8.5]
4th Approximation: x = 8.4375
Associated Error: ±0.0625 units
√
Answer: 71 ≈ 8.4375 with a maximum error in this approximation of 0.0625.
Question 10 Solution
Step 1) Determine the nonlinear function we will use for the bisection algorithm.
1
x= √ 5
3
5 1
x =
3
3x5 = 1
3x5 − 1 = 0
We will use f (x) = 3x5 − 1.
Step 2) Find the first interval, first approximation and the associated error.
1
Since 0 < √ 5
3
< 1, we should be able to use [0, 1] as the first interval. A
quick check of the function values confirms this.
x f (x)
0 −1
1 2
1st Interval: [0, 1]
1st Approximation: x = 0.5
Associated Error: ±0.5 units
Step 3) Determine the second interval, second approximation and the associated
error.
© http://www.mathwarehouse.com
2nd Interval: [0.5, 1]
2nd Approximation: x = 0.75
Associated Error: ±0.25 units
Step 4) Find the third interval, third approximation and its associated error.
Question 11 Solution
√
Step 1) Find a nonlinear function with a root at 125.
√
x= 125
2
x = 125
2
x − 125 = 0
Step 3) Determine the second interval, the second approximation, and the as-
sociated error value.
© http://www.mathwarehouse.com
Finding the 2nd Interval
x f (x)
Current left-endpoint 11 f (11) = −4
Midpoint 11.5 f (11.5) = 7.25
Current right-endpoint 12 f (12) = 19
2nd Interval: [11, 11.5]
2nd Approximation: x = 11.25 with a maximum error of 0.25 units.
Step 4) Determine the third interval, the third approximation, and the associ-
ated error value.
Question 12 √
4
12500
Step 1) Find a nonlinear function with a root at 2 .
√
4
12500
x=
2
12500
x4 =
16
3125
x4 =
4
4x4 = 3125
4x4 − 3125 = 0
Step 2) Determine the appropriate starting interval, the first approximation and
the associated error.
Since 104 = 10,000 is about the right size, we try f (10) = 36,875
© http://www.mathwarehouse.com
By comparison, f (5) = −625, so the best starting interval is somewhere
between x = 5 and x = 10. Let’s make a table of values to help us narrow
things down.
x f (x)
5 −625
6 2059
Well, that was convenient.
Step 4) Repeat Step 3 until the maximum error is smaller than the allowed
tolerance.
© http://www.mathwarehouse.com
Finding the 4th Interval
x f (x)
Current left-endpoint 5.25 f (5.25) ≈ −86.2
Midpoint 5.375 f (5.375) ≈ 213.7
Current right-endpoint 5.5 f (5.5) = 535.25
1
√
Answer: 2 · 4
12500 ≈ 5.3125 with a maximum error of 0.0625.
Question 13 Solution
Step 1) Solve 0.5n (b − a) for n when a = 2 and b = 5.
0.5n (5 − 2) = 0.01
1
0.5n · 3 =
10
n
1 1
=
2 30
1 1
n · ln = ln
2 30
n · (ln 1 − ln 2) ln 1 − ln 30
−n ln 2 = − ln 30
ln 30
n=
ln 2
≈ 4.90732
Answer We will need to use at least 5 iterations in order to ensure the accuracy.
Question 14
© http://www.mathwarehouse.com
Step 1) Solve 0.5n (b − a) = 0.02 for n when a = −1 and b = 1.
n (ln 1 − ln 2) = ln 1 − ln 100
−n ln 2 = − ln 100
ln 100
n=
ln 2
≈ 6.64473
Answer: We will need at least 7 iterations before the error tolerance is reached.
Author: HT Goodwill
By downloading this page, you agree to the Terms of Service as described :
http://www.mathwarehouse.com/copyright.php
© http://www.mathwarehouse.com