Roots of Nonlinear Functions
Roots of Nonlinear Functions
1
Theorem 2.1 (Intermediate value theorem) Let f be a continuous func-
tion on the interval [a, b], and let k be any number between f (a) and f (b)
inclusive. Then there exists a number c in [a, b] such that f (c) = k.
Corollary 2.1 Let f be a continuous function on the interval [a, b], and let
f (a) and f (b) have opposite signs. Then f has a root in [a, b].
The bisection method begins by choosing two values a and b, such that f (a)
and f (b) have opposite signs. By Corollary 2.1 we are guaranteed that there
will be a root somewhere in-between. This is known as bracketing the root.
Now let p be the midpoint of [a, b]. Either p is the root (in which case we
are done), or else the root lies in one of the intervals (a, p) or (p, b). By
comparing the sign of f (p) with that of f (a) and f (b) we can immediately
tell which interval contains the root. Thus, we now have an interval of half
the size that still brackets the root.
By repeating this process as many times as necessary, we can get an
arbitrarily small interval bracketing the root. Typically we continue the
process until the midpoint of the interval is unchanged to a given number of
decimal places from one iteration to the next.
f (x) = x3 − 4x + 2
The bisection method has the advantage that it is simple to apply, and
requires only that the root be initially bracketed in order to succeed. It is,
however, quite slow to converge. In the next sections, we will investigate
methods that offer improved rates of convergence, but with the price that
they have stricter requirements to guarantee success.
2
2.2 Fixed point iteration
(Bradie, Section 2.3)
Fixed point iteration is based on the idea of rearranging (2.1) into the
form
x = g(x) . (2.2)
The equation is solved if we can find a number p such that p = g(p). Such a
number is called a fixed point of g.
Under what circumstances does a function have a fixed point? Under what
circumstances is the fixed point unique? To answer these questions, we need
the following theorem from calculus.
f (b) − f (a)
f ′ (c) = .
b−a
Using the intermediate value theorem (Theorem 2.1) and the mean value
theorem (Theorem 2.2), we can prove the fixed point theorem.
3
Definition 2.2 The iteration xn+1 = g(xn ) for n = 0, 1, 2, . . . is called
fixed-point iteration.
It turns out that the conditions that guarantee a unique fixed point (The-
orem 2.3) also guarantee that fixed point iteration will converge to that point.
Theorem 2.4 Let g be continuous on [a, b] and g(x) in [a, b] for all x in
[a, b]. Furthermore, let g be differentiable on (a, b) and a positive constant
k < 1 exist such that |g ′(x)| ≤ k for all x in (a, b). Then the iteration
xn+1 = g(xn ) converges to the unique fixed point p in [a, b] for any x0 in
[a, b].
(b) Determine which form will converge to the solution on the interval [0, 1].
f (x) = x3 − 4x + 2
4
(a) Find two different forms for g.
(b) Determine which form will converge to the root on the interval [1, 2].
It can be shown (Bradie, p.90) that when fixed point iteration converges
to p, the sequence it generates, {xn }, satisfies
|xn+1 − p| ≈ λ|xn − p|
where 0 < λ < 1 and n is sufficiently large. In other words, the error in the
solution decreases by roughly a factor of λ at each iteration, in the long run
(the value of λ depends on the properties of g). For instance, if λ = 0.1, then
in the long run, the number of correct digits in the solution will increase by
one approximately each iteration.
Newton’s method is one of the most widely used methods for finding roots
of nonlinear functions. In essence, it approximates a nonlinear function by its
tangent line at the current iterate, and computes the next iterate by finding
the x-intercept of the tangent line.
This leads to the sequence of iterates given by
f (xn )
xn+1 = xn − .
f ′ (xn )
f (x) = x3 − 4x + 2
5
on the interval [1, 2] correct to four decimal places.
where λ > 0 and n is sufficiently large. This means that, in the long run,
the number of correct digits in the solution will roughly double with each
iteration.
f (xn ) − f (xn−1 )
f ′ (xn ) ≈
xn − xn−1
xn − xn−1
xn+1 = xn − f (xn )
f (xn ) − f (xn−1 )
f (x) = x3 − 4x + 2
6
on the interval [1, 2] correct to three decimal places.
It can be shown (Bradie, p.109) that when the secant method converges
to p, the sequence it generates, {xn }, satisfies
where λ > 0 and n is sufficiently large. Thus, the price for approximating the
derivative is a reduced rate of convergence compared to Newton’s method.
2.5 Exercises
1. Use the bisection method to find the root of x3 − x − 1 on the interval
[1, 2] correct to two decimal places.
3. Use the bisection method to find all the roots of f (x) = x2 + 10 cos(x)
correct to two decimal places.
*4. A water trough of length L has a cross section in the shape of a semi-circle
of radius r. When filled with water to within a distance h of the top, the
volume V of water is given by
√
V = L[0.5πr 2 − r 2 sin−1 (h/r) − h r 2 − h2 ].
(a) Rearrange this function to find four different forms for fixed point
iteration (i.e. the form x = g(x)).
(b) Perform four iterations of xn+1 = g(xn ), if possible, using each of the
functions you found in (a) and x0 = 1.
7
(c) Which g function, if any, appears to be converging to the solution of
f (x) = 0 around x = 1?
*7. Suppose we wish to find the solution to x = tan(x) on the interval [4, 4.5]
using fixed point iteration.
8. Use fixed point iteration to find all the roots of f (x) = x2 + 10 cos(x)
correct to two decimal places. Use trial and error to select an appropriate
form for g.
*9. An object falling vertically through the air is subjected to viscous resis-
tance as well as the force of gravity. The following model predicts the
height of an object of mass m, t seconds after having been dropped from
a height of H0 as:
mg m2 g
H(t) = H0 + t − 2 (1 − e−kt/m )
k k
10. Use Newton’s method to find the root of x3 − x − 1 on the interval [1, 2]
correct to four decimal places.
8
*11. Use Newton’s method to find a solution to x = tan(x) on the interval
[4, 4.5] correct to four decimal places.
12. Use Newton’s method to find all the roots of f (x) = x2 + 10 cos(x) correct
to four decimal places.
13. Use the secant method to find the root of x3 − x − 1 on the interval [1, 2]
correct to three decimal places.
14. Use the secant method to find a solution to x = tan(x) on the interval
[4, 4.5] correct to three decimal places.
15. Use the secant method to find all the roots of f (x) = x2 +10 cos(x) correct
to three decimal places.