0% found this document useful (0 votes)
15 views9 pages

Roots of Nonlinear Functions

This document discusses numerical methods for finding roots of nonlinear functions, including the bisection method, fixed point iteration, Newton's method, and the secant method. It provides definitions and theorems regarding each method, worked examples of applying the methods, and convergence properties.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views9 pages

Roots of Nonlinear Functions

This document discusses numerical methods for finding roots of nonlinear functions, including the bisection method, fixed point iteration, Newton's method, and the secant method. It provides definitions and theorems regarding each method, worked examples of applying the methods, and convergence properties.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Chapter 2

Roots of nonlinear functions

One of the most important problems in computational mathematics is finding


the solution to an equation
f (x) = 0. (2.1)

Finding such solutions, or roots, is straightforward if the function is linear,


i.e. f (x) = ax+ b, or if it is one of a handful of “familiar” nonlinear functions
such as f (x) = ax2 + bx + c or f (x) = aebx − d. But aside from a few special
cases, most nonlinear functions will resist any attempts to find their roots
analytically. What are the roots of f (x) = x − cos(x) for instance?
In this topic, we examine numerical methods for finding roots of nonlinear
functions, which can be used when analytic methods fail. Note that any
nonlinear equation can be written in the form f (x) = 0 by simply moving
every term over to the left hand side, so the methods we develop here are
quite general.

2.1 Bisection method


(Bradie, Section 2.1)

The bisection method is a very simple rootfinding method that relies on


the intermediate value theorem.

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.

Example 2.1 Use the bisection method to solve



0.9 cos(x) = x

on the interval [0, 1] correct to two decimal places.

Example 2.2 Use the bisection method to find the root of

f (x) = x3 − 4x + 2

on the interval [1, 2] correct to two decimal places.

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.

Definition 2.1 A fixed point of a function g is a number p that satisfies


p = g(p).

Example 2.3 Find the fixed points of the function g(x) = x2 − 2.

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.

Theorem 2.2 (Mean value theorem) Let f be continuous on [a, b] and


differentiable on (a, b). There there exists a number c in (a, b) such that

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.

Theorem 2.3 (Fixed point theorem) Let g be continuous on [a, b] and


g(x) in [a, b] for all x in [a, b]. Then g has a fixed point in [a, b]. Furthermore,
if g is differentiable on (a, b) and a positive constant k < 1 exists such that
|g ′ (x)| ≤ k for all x in (a, b), then the fixed point in [a, b] is unique.

How do we actually compute the fixed point? Assuming the function is


too complicated to solve analytically, the answer is to use iteration. Start
with an initial iterate, or “initial guess” x0 , and compute x1 = g(x0 ). Then,
compute x2 = g(x1 ). And so on. This generates a sequence {x0 , x1 , x2 , . . . , }
that, under the right conditions, will converge to the fixed point.

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].

The process of applying fixed point iteration consists of:

1. finding a rearrangement x = g(x) of f (x) = 0;

2. checking that this rearrangement satisfies the conditions of Theorems


2.3 and 2.4 on some suitable interval;

3. performing the iteration xn+1 = g(xn ) until a satisfactory solution is


obtained.

Example 2.4 Suppose we wish to solve



0.9 cos(x) = x

on the interval [0, 1] using fixed point iteration.

(a) Find two different forms for g.

(b) Determine which form will converge to the solution on the interval [0, 1].

(c) Find the solution to two decimal places.

Example 2.5 Suppose we wish to find the root of

f (x) = x3 − 4x + 2

on the interval [1, 2] using fixed point iteration.

4
(a) Find two different forms for g.

(b) Determine which form will converge to the root on the interval [1, 2].

(c) Find the root to two decimal places.

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.

2.3 Newton’s method


(Bradie, Section 2.4)

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 )

Example 2.6 Use Newton’s method to solve



0.9 cos(x) = x

on the interval [0, 1] correct to four decimal places.

Example 2.7 Use Newton’s method to find the root of

f (x) = x3 − 4x + 2

5
on the interval [1, 2] correct to four decimal places.

It can be shown (Bradie, p.100) that when Newton’s method converges


to p, the sequence it generates, {xn }, satisfies

|xn+1 − p| ≈ λ|xn − p|2

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.

2.4 Secant method


(Bradie, Section 2.5)

While Newton’s method has the desirable property of rapid convergence, it


also requires that the derivative of f be known.
The secant method overcomes this limitation by approximating the deriva-
tive using the slope of the secant connecting the points (xn−1 , f (xn−1 )) and
(xn , f (xn )). That is, it approximates f ′ (xn ) by

f (xn ) − f (xn−1 )
f ′ (xn ) ≈
xn − xn−1

This leads to the sequence of iterates given by

xn − xn−1
xn+1 = xn − f (xn )
f (xn ) − f (xn−1 )

Example 2.8 Use the secant method to solve



0.9 cos(x) = x

on the interval [0, 1] correct to three decimal places.

Example 2.9 Use the secant method to find the root of

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

|xn+1 − p| ≈ λ|xn − p|1.618

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.

2. Use the bisection method to find a solution to x = tan(x) on the interval


[4, 4.5] 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 ].

Suppose L = 3m, r = 0.3m and V = 0.35m3 . Use the bisection method


to find the depth of water in the trough to within 0.1cm.

5. Let f (x) = x4 + 2x2 − x − 3.

(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?

6. Suppose we wish to find the root of x3 − x − 1 on the interval [1, 2] using


fixed point iteration.

(a) Find two different forms for g.


(b) Determine which form will converge to the root on the interval [1, 2].
(c) Find the root to two decimal places using an appropriate initial guess.

*7. Suppose we wish to find the solution to x = tan(x) on the interval [4, 4.5]
using fixed point iteration.

(a) Find two different forms for g.


(b) Determine which form will converge to the root on the interval [4, 4.5].
(c) Find the root to two decimal places using an appropriate initial guess.

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

where g = −9.81m/s2 and k = 0.015kg s/m. Suppose H0 = 100m and


m = 0.1kg. Use fixed point iteration to find the time it takes for this
mass to hit the ground, to within 0.01s. Use trial and error to select an
appropriate form for g.

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.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy