Example 1
Consider finding the root of f(x) = x2 - 3. Let εstep = 0.01, εabs = 0.01 and start with the interval [1, 2].
Table 1. Bisection method applied to f(x) = x2 - 3.
a | b | f(a) | f(b) | c = (a + b)/2 | f(c) | Update | new b − a |
---|---|---|---|---|---|---|---|
1.0 | 2.0 | -2.0 | 1.0 | 1.5 | -0.75 | a = c | 0.5 |
1.5 | 2.0 | -0.75 | 1.0 | 1.75 | 0.062 | b = c | 0.25 |
1.5 | 1.75 | -0.75 | 0.0625 | 1.625 | -0.359 | a = c | 0.125 |
1.625 | 1.75 | -0.3594 | 0.0625 | 1.6875 | -0.1523 | a = c | 0.0625 |
1.6875 | 1.75 | -0.1523 | 0.0625 | 1.7188 | -0.0457 | a = c | 0.0313 |
1.7188 | 1.75 | -0.0457 | 0.0625 | 1.7344 | 0.0081 | b = c | 0.0156 |
1.71988/td> | 1.7344 | -0.0457 | 0.0081 | 1.7266 | -0.0189 | a = c | 0.0078 |
Thus, with the seventh iteration, we note that the final interval, [1.7266, 1.7344], has a width less than 0.01 and |f(1.7344)| < 0.01, and therefore we chose b = 1.7344 to be our approximation of the root.
Example 2
Consider finding the root of f(x) = e-x(3.2 sin(x) - 0.5 cos(x)) on the interval [3, 4], this time with εstep = 0.001, εabs = 0.001.
Table 1. Bisection method applied to f(x) = e-x(3.2 sin(x) - 0.5 cos(x)).
a | b | f(a) | f(b) | c = (a + b)/2 | f(c) | Update | new b − a |
---|---|---|---|---|---|---|---|
3.0 | 4.0 | 0.047127 | -0.038372 | 3.5 | -0.019757 | b = c | 0.5 |
3.0 | 3.5 | 0.047127 | -0.019757 | 3.25 | 0.0058479 | a = c | 0.25 |
3.25 | 3.5 | 0.0058479 | -0.019757 | 3.375 | -0.0086808 | b = c | 0.125 |
3.25 | 3.375 | 0.0058479 | -0.0086808 | 3.3125 | -0.0018773 | b = c | 0.0625 |
3.25 | 3.3125 | 0.0058479 | -0.0018773 | 3.2812 | 0.0018739 | a = c | 0.0313 |
3.2812 | 3.3125 | 0.0018739 | -0.0018773 | 3.2968 | -0.000024791 | b = c | 0.0156 |
3.2812 | 3.2968 | 0.0018739 | -0.000024791 | 3.289 | 0.00091736 | a = c | 0.0078 |
3.289 | 3.2968 | 0.00091736 | -0.000024791 | 3.2929 | 0.00044352 | a = c | 0.0039 |
3.2929 | 3.2968 | 0.00044352 | -0.000024791 | 3.2948 | 0.00021466 | a = c | 0.002 |
3.2948 | 3.2968 | 0.00021466 | -0.000024791 | 3.2958 | 0.000094077 | a = c | 0.001 |
3.2958 | 3.2968 | 0.000094077 | -0.000024791 | 3.2963 | 0.000034799 | a = c | 0.0005 |
Thus, after the 11th iteration, we note that the final interval, [3.2958, 3.2968] has a width less than 0.001 and |f(3.2968)| < 0.001 and therefore we chose b = 3.2968 to be our approximation of the root.
Example 3
Apply the bisection method to f(x) = sin(x) starting with [1, 99], εstep = εabs = 0.00001, and comment.
After 24 iterations, we have the interval [40.84070158, 40.84070742] and sin(40.84070158) ≈ 0.0000028967. Note however that sin(x) has 31 roots on the interval [1, 99], however the bisection method neither suggests that more roots exist nor gives any suggestion as to where they may be.
Copyright ©2005 by Douglas Wilhelm Harder. All rights reserved.