Continuous Functions
Read this section for an introduction to what we mean when we say a function is continuous. Work through practice problems 1 and 2.
Bisection Algorithm for Approximating Roots
Bisection Algorithm for Finding a Root of f(x)
(i) Find two values of , say a and , so that and have opposite signs (then has a root between a and , a root in the interval ).
(ii) Calculate the midpoint (bisection point) of the interval , and evaluate .
(iii) (a) If , then is a root of , and we are done.
(b) If , then has the sign opposite one of or :
if and have opposite signs, then has a root in so put
if and have opposite signs, then has a root in so put
(iv) Repeat steps (ii) and (iii) until a root is found exactly or is approximated closely enough.
The length of the interval known to contain a root is cut in half each time through steps (ii) and (iii) so the Bisection Algorithm quickly "squeezes" in on a root (Fig. 10).
The steps of the Bisection Algorithm can be done "by hand", but it is tedious to do very many of them that way. Computers are very good with this type of tedious repetition, and the algorithm is simple to program.
Solution: and so we cannot conclude that has a root between 0 and 1. and have opposite signs, so by the Intermediate Value Property of continuous functions (this function is a polynomial so it is continuous everywhere) we know that there is a number between 1 and 2 such that (Fig. 11). The midpoint of the interval is , and so changes sign between 1 and and we can be sure that there is a root between 1 and . If we repeat the operation for the interval , the midpoint is , and so changes sign between and and we know has a root between and .
Repeating this procedure a few more times, we get that
a |
b |
root between |
|||||
1 |
2 |
|
1 |
−5 |
|
1 |
2 |
1 |
2 |
1.5 |
1 |
−5 |
–0.875 |
1 |
1.5 |
1 |
1.5 |
1.25 |
1 |
−0.875 |
0.2969 |
1.25 |
1.5 |
1.25 |
1.5 |
1.375 |
0.2969 |
−0.875 |
–0.2246 |
1.25 |
1.375 |
1.25 |
1.375 |
1.3125 |
0.2969 |
−0.2246 |
0.0515 |
1.3125 |
1.375 |
1.3125 |
1.375 |
1.34375 |
|
If we continue the table, the interval containing the root will squeeze around the value .
The Bisection Algorithm has one major drawback - there are some roots it does not find. The algorithm requires that the function be both positive and negative near the root so that the graph actually crosses the -axis. The function has the root but is never negative (Fig. 12).
We cannot find two starting points a and so that and have opposite signs, and we cannot use the Bisection Algorithm to find the root . In Chapter 2 we will see another method, Newton's Method, which does find roots of this type.
The Bisection Algorithm requires that we supply two starting points and , two -values at which the function has opposite signs. These values can often be found with a little "trial and error", or we can examine the graph of the function and use it to help pick the two values.
Finally, the Bisection Algorithm can also be used to solve equations because the solution of any equation can always be transformed into an equivalent problem of finding roots by moving everything to one side of the equal sign. For example, the problem of solving the equation can be transformed into the equivalent problem of solving or of finding the roots of which we did in the previous example.
Example 8: Find all of the solutions of . ( is in radians).
Solution: We can convert this problem of solving an equation to the problem of finding the roots of . The function is continuous everywhere except at , and the graph of in Fig. 13 can help us find two starting values for the Bisection Algorithm. The graph shows that is negative and is positive, and we know is continuous on the interval . Using the algorithm with the starting interval , we get that the root is contained in the shrinking intervals:
so the root is approximately .
We might also notice that is positive and is negative. Why is it wrong to conclude that has another root between and