Professional Documents
Culture Documents
NON-LINEAR EQUATIONS
INTRODUCTION
In this topic you will learn several methods of solving
numerically the non-linear equation f ( x) = 0 . This root-finding
problem is one of the most basic problems of numerical
approximation. The solution to f ( x) = 0 is a root of f as
defined below:
1
2.1 FIXED-POINT ITERATION
In general, we can write a non-linear equation y = f ( x) = 0 in
the form
x = g ( x) . (2.1)
f ( x) = 5 x3 − 10 x + 3 = 0 .
10 x = 5 x 3 + 3 ,
x = g ( x) = 0.5 x3 + 0.3 .
2
iteration.
pk +1 = g ( pk ) (2.2)
p1 = g ( p0 )
p2 = g ( p1 )
M
(2.3)
pk = g ( pk −1 )
pk +1 = g ( pk )
M
pk +1 − g ( pk ) ≤ ε (2.4)
3
Example 2.1
Solution:
Consider the first 100 terms obtained using the iteration rule:
{ pk }k =0
∞
Suppose that g ( x) is a continuous function and is a
4
sequence generated by the fixed-point iteration. If lim pk = P ,
k →∞
then P is a fixed point of g ( x) .
Theorem 2.2
5
The following example illustrates the theorem above.
Example 2.2
Solution:
Case 1: P = −2
(−2.05) 2
p1 = 1 + (−2.05) − = −2.100625
4
p2 = −2.20378135
p3 = −2.41794441
M
lim pk = −∞
k →∞
Since
6
g ′( x) > 32 > 1
on [ −3, −1] and from Theorem 2.3, the sequence does not
converge to P = −2 .
Case 2: P = 2
(1.6) 2
p1 = 1 + 1.6 − = 1.96
4
p2 = 1.9996
p3 = 1.99999996
M
lim pk = 2
k →∞
Notice that Theorem 2.3 does not say anything about the case
g ′( P ) = 1. Now, consider the following example.
Example 2.3
Solution:
7
We determine the fixed points by finding the solutions of
P = 2( P − 1)1/ 2 . This yields P = 2 . Next, we obtain the
derivative, g ′( x) = 1/( x − 1)1/ 2 giving g ′(2) = 1. Hence Theorem
2.3 cannot be used. There are two cases to be considered
when we initially set the starting value, either to the left or right
of P = 2 .
Therefore, we obtain
p1 = 1.41421356
p2 = 1.28718851
p3 = 1.07179943
p4 = 0.53590832
p5 = 2(−0.46409168)1 2
Therefore, we obtain
p1 = 2.44948974
p2 = 2.40789513
p3 = 2.37309514
p4 = 2.34358284
M
lim pk = 2
k →∞
8
This sequence converges slowly to the value of P = 2 .
If f (a ) and f (c) are of opposite signs, a root exists in the interval [a, c].
(2.5)
If f (c) and f (b) are of opposite signs, a root exists in the interval [c, b].
(2.6)
9
that, we have bracketed the root in an interval that is smaller
than the original interval. To continue the process, we
relabeled the new interval that contains the root and repeat
the process until the interval width is as small as desired.
Thus we generate a sequence of nested intervals and their
midpoints. The details of the process can be described as
follows:
an + bn
where cn = and either
2
10
Theorem 2.4 (Bisection Theorem)
b−a
r − cn ≤ for n = 0,1,K (2.10)
2n+1
{cn }n=0
∞
and therefore the sequence converges to the root
x = r , that is,
lim cn = r (2.11)
n→∞
Example 2.4
Solution:
x sin( x) − 1 = 0 .
11
function f ( x) = x sin( x) − 1 . Start with a0 = 0 and b0 = 2 , we
compute
r ≈ 1.114157141 .
12
⎛ ln(b − a ) − ln(∆ ) ⎞
N = int ⎜ ⎟. (2.12)
⎝ ln(2) ⎠
Join the points (a, f (a )) and (b, f (b)) with a straight line L that
cuts the x -axis at the point (c, 0) . To determine the value of c
we write two versions of the slope m of the straight line L .
They are
f (b) − f (a )
m= (2.13)
b−a
f (b) − 0
m= (2.14)
b−c
f (b) − f (a ) f (b) − 0
= .
b−a b−c
13
Thus, we obtain
f (b)(b − a )
c=b− (2.15)
f (b) − f (a )
If f (a ) and f (c) are of opposite signs, a root exists in the interval [a, c].
(2.16)
If f (c) and f (b) are of opposite signs, a root exists in the interval [c, b].
(2.17)
f (bn )(bn − an )
cn = bn − (2.19)
f (bn ) − f (an )
Example 2.5
14
Solution:
0.81859485(2 − 0)
c0 = 2 − = 1.09975017
0.81859485 − (−1)
[c0 , b0 ] = [1.09975017, 2] .
Therefore we narrow the interval from the left and set
a1 = c0 and b1 = b0 .
0.81859485(2 − 1.09975017)
c1 = 2 − = 1.12124074
0.81859485 − (−0.02001921)
[ a1 , c1 ] = [1.09975017, 1.12124074] .
15
Therefore, the next decision is to narrow the interval from the
right. Thus, we set
a2 = a 1 and b2 = c1 .
16
If f ( x) , f ′( x) and f ′′( x) are continuous near a root p , then
this additional information can be used to develop algorithms
that will generate sequences { pk } that converge to p faster
than either the bisection or the false position methods. The
Newton-Raphson method is an algorithm that depends on the
continuity of f ′( x) and f ′′( x) . We shall introduce the method
graphically.
17
The gradient of the tangent at the point ( p0 , f ( p0 ) ) :
m = f ′( p0 ) (2.21)
Equating the two equations (2.20) and (2.21) and solving for
p1 , we obtain
f ( p0 )
p1 = p0 − (2.22)
f ′( p0 )
http://archives.math.utk.edu/visual.calculus/3/newton.5/
f ( pk −1 )
pk = pk −1 − for k = 1, 2,K (2.23)
f ′( pk −1 )
18
Remark: The function g ( x) defined by
f ( x)
g ( x) = x − (2.24)
f ′( x)
pk −1 + A pk −1
pk = for k = 1, 2,K (2.25)
2
{ pk }k =0
∞
Then the sequence converges to A , that is
lim pk = A .
k →∞
Example 2.6
Solution:
19
write the Newton-Raphson iteration function
f ( x) x2 − A
g ( x) = x − = x− (2.26)
f ′( x) 2x
x+ A x
g ( x) = (2.27)
2
2 + 5/ 2
p1 = = 2.25
2
2.25 + 5 / 2.25
p2 = = 2.236111111
2
2.236111111 + 5 / 2.236111111
p3 = = 2.236067978
2
2.236067978 + 5 / 2.236067978
p4 = = 2.236067978
2
20
discussion and we shall investigate the rate of convergence of
an iteration.
and f ( M ) ( p) ≠ 0 (2.28)
Lemma 2.1
f ( x) = ( x − p) M h( x) , where h( x) ≠ 0 . (2.29)
Example 2.7
21
its roots.
Solution:
f ′( x) = 3x 2 − 3 and f ′′( x) = 6 x
f ( x) = ( x + 2)( x − 1) 2
f ( p) = ( p + 2)( p − 1) 2 = 0
22
sequence as a measure of how rapidly a sequence
converges.
p − pn+1 en+1
lim = lim =A (2.30)
p − pn
n→∞ R n→∞ R
en
{ p n }n =0
∞
If R = 1, the convergence of the sequence is called
linear. (2.31)
{ p n }n =0
∞
If R = 2 , the convergence of the sequence is called
quadratic. (2.32)
23
p = −2 for the polynomial f ( x) = x3 − 3x + 2 . Start with an initial
value of p0 = −2.4 .
Solution:
f ( pk −1 )
pk = g ( pk −1 ) = pk −1 −
f ′( pk −1 )
pk3−1 − 3 pk −1 + 2
pk = g ( pk −1 ) = pk −1 −
3 pk2−1 − 3
or
2 pk3−1 − 2
pk = 2 (2.33)
3 pk −1 − 3
ek +1
k pk pk +1 − pk ek = p − pk 2
ek
0 -2.400000000 0.323809524 0.400000000 0.476190476
1 -2.076190476 0.072594466 0.076190476 0.619469027
2 -2.003596011 0.003587421 0.003596011 0.664277916
3 -2.000008590 0.000008590 0.000008590 0.666660828
4 -2.000000000
24
If we investigate the rate of convergence in the example
above, we will notice that the error in each successive
iteration is proportional to the square of the error in the
previous iteration. That is,
p − pk +1 ≈ A p − pk
2
2
where A = ≈ 0.66666667 .
3
Solution:
ek +1
k pk pk +1 − pk ek = p − pk
ek
0 1.200000000 -0.96969697 -0.200000000 0.515151515
1 1.103030303 -0.050673883 -0.103030303 0.508165253
2 1.052356420 -0.025955609 -0.052356420 0.496751115
3 1.026400811 -0.013143081 -0.026400811 0.509753688
4 1.013257730 -0.006614311 -0.013257730 0.501097775
5 1.006643419 -0.003318055 -0.006643419 0.500550093
M M M M M
25
f ( pk )
values of f ′( pk ) . Hence, the value of in equation
f ′( pk )
(2.24) is defined when pk ≠ p . The sequence converges
linearly and its error is decreasing by a factor of approximately
1 2 with each successive iteration.
f ( x) .
1 f ′′( p )
en+1 ≈
2
en for n sufficiently large. (2.34)
2 f ′( p )
M −1
en+1 ≈ en for n sufficiently large. (2.35)
M
1 f ′′(−2) 1 −12 2
A= = =
′
2 f (−2) 2 9 3
26
In the following Theorem, we shall state a result of the
Newton-Rapnson iteration that will yield a quadratic
convergence at a multiple root.
f ( pk −1 )
pk = pk −1 − M , k = 1, 2,K (2.36)
′
f ( pk −1 )
to p .
Solution:
f ( pk −1 ) pk3−1 + 3 pk −1 − 4
pk = pk −1 − 2 =
f '( pk −1 ) 3 pk2−1 − 3
27
The results are given below:
ek +1
k pk pk +1 − pk ek = p − pk 2
ek
0 1.200000000 -0.193939394 -0.200000000 0.151515150
1 1.006060606 -0.006054519 -0.006060606 0.165718578
2 1.000006087 -0.000006087 -0.000006087
3 1.000000000 -0.000000000 -0.000000000
p1 = −4.01525255, p2 = −4.85265757,K
28
the sequence { pk } might diverge to +∞ . For example, using
the starting value p0 = 2 in (2.23) for the function y = xe − x , we
obtain
29
To overcome such a difficulty, we can choose an initial
approximation very close to the desired root. Then we can
guarantee a convergent sequence. Thus we need a prior
knowledge of the location of the desired root in order to set
the initial approximation of the root. This is not very difficult
since we can use the bracketing method to estimate or
determine the location of the root within a predetermined
interval. If knowledge of the behavior of the function or a
graph is available, then an initial approximate root is easy to
guess.
30
Define p2 as the intersection point between the x -axis and
the straight line passing through these two points. Then p2 is
nearer to p than to either p1 or p0 . The equation relating p2 ,
p1 and p0 can be derived by considering the slope
f ( p1 ) − f ( p0 ) 0 − f ( p1 )
m= = (2.37)
p1 − p0 p2 − p1
f ( p1 ) ( p1 − p0 )
p2 = g ( p1 , p0 ) = p1 − (2.38)
f ( p1 ) − f ( p0 )
f ( pk ) ( pk − pk −1 )
pk +1 = g ( pk , pk −1 ) = pk − for k = 1, 2,K (2.39)
f ( pk ) − f ( pk −1 )
31
Example 2.11 (Secant Method at a Simple Root)
Solution:
( pk3 − 3 pk + 2) ( pk − pk −1 )
pk +1 = g ( pk , pk −1 ) = pk − (2.40)
( pk3 − pk3−1 − 3 pk + 3 pk −1 )
pk2 pk −1 + pk pk2−1 − 2
pk +1 = g ( pk , pk −1 ) = 2 (2.41)
pk + pk pk −1 + pk2−1 − 3
ek +1
k pk pk +1 − pk ek = p − pk 1.618
ek
0 -2.600000000 0.200000000 0.600000000 0.914152831
1 -2.400000000 0.293401015 0.400000000 0.469497765
2 -2.106598985 0.083957573 0.106598985 0.847290012
3 -2.022641412 0.021130314 0.022641412 0.693608922
4 -2.001511098 0.001488561 0.001511098 0.825841116
5 -2.000022537 0.000022515 0.000022537 0.727100987
6 -2.000000022 0.000000022 0.000000022
7 -2.000000000 0.000000000 0.000000000
32
two-point secant method g ( pk , pk −1 ) will reduce to a single
point Newton’s method g ( pk ) if pk is replaced by pk −1 . In fact,
if pk is replaced by pk −1 in equation (2.41), then the right-hand
side is the same as the right-hand side of equation (2.33).
SUMMARY
In this chapter you have studied some numerical techniques
of approximating a root of nonlinear equations of a single
variable. The various methods have their own advantages and
disadvantages. In real applications we ought to, for example,
employ two techniques in succession.
EXERCISES
ANSWERS
33
1. p1 = 0.3005, p2 = 0.31357, p3 = 0.31542
k pk f ( pk )
0 1.4545454545 1.5401953418
1 1.3689004011 0.0607196886
2 1.3652366002 0.0001087706
3 1.3652300134 0.0000000004
34
k pk f ( pk )
0 0 1.0000
1 1 -0.63212
2 0.61270 -0.07081
3 0.56384 0.00518
4 0.56717 -0.00004
REFERENCE
1. Faires, J. D. and Burden, R. 2003. Numerical Methods. 3rd
Ed. Brooks/Cole: USA.
35