Mat575 Chapter 3-Newton & Secant
Mat575 Chapter 3-Newton & Secant
Chapter 3
Newton’s &
Secant
Methods
At the end of this chapter, students should be able to:
• Derive Newton’s and Secant methods graphically and algebraically
• Apply Newton’s and Secant methods for solving non-linear equations
• Determine the rate of convergence of different root finding methods
3.1 Introduction
In Chapter 2, the Bisection method has been discussed for solving non-linear
equations. Based on the examples given, we conclude that if the existence of a
root is guaranteed then the method always converge to the required root. Even
though the Bisection method is perhaps a simple method, its approach is
relatively inefficient due to slow convergence rate. In contrast, the Newton’s and
Secant methods to be discussed in this chapter are generally more
computationally efficient.
31
Part 2 SOLVING NONLINEAR EQUATION MAT 575
Geometric Derivation
y y = f (x )
L0
Actual
root r
x
x2 x1 x0
Figure 3.1
solution for the equation f ( x ) = 0 . Say, for instance, one root is known to lie
root calls for an initial guess x 0 to be made. The line L0 tangent to the graph
32
Part 2 SOLVING NONLINEAR EQUATION MAT 575
first, x 0 .
If the procedure is then repeated by finding the line L1 tangent to the graph of f at
approximation to the actual root than x1 . The procedure is repeated again and
again, until an approximation of sufficiently high accuracy is obtained.
We can obtain a simple equation for obtaining the (n + 1)th approximation, x n +1 ,
y y = f (x )
Ln
Ln+1
Actual
root r
x
xn+1 xn
Figure 3.2
given by the derivative f' (x n ) , the equation for Ln can be written as:
f ( xn )
x n +1 = x n − , f ' (x n ) ≠ 0
f ' ( xn )
33
Part 2 SOLVING NONLINEAR EQUATION MAT 575
Algebraic Derivation
Newton’s method can also be derived based upon the Taylor polynomial.
Suppose that the function f (x ) is twice continuously differentiable on the interval
[a, b]. Let x n ∈ [a, b] be an approximation to the true root r such that
(r - x n ) 2
f(r) = f(x n ) + (r - x n )f ' (x n ) + f " ( ξ) (1)
2
where ξ in between x and xn . Since f (r ) = 0 , with x = r , gives
(r - x n )2
0 = f(x n ) + (r - x n )f ' (x n ) + f( ξ)
2
2
Since xn - r is assumed to be small, xn - r is even smaller, and if this
Theorem
Assume that f ∈ C 2 [a, b] and there exists a number r ∈ [a, b] , where f (r ) = 0 .
the iteration
f(rn )
rn +1 = rn - for n = 0, 1, 2, …
f ' (rn )
34
Part 2 SOLVING NONLINEAR EQUATION MAT 575
Example 1
For the x - cosx = 0 , use the Newton’s method with three iterations to find a
solution to the equation given x0 = 1.4 . What can be said about the accuracy
of the estimated value (root)?
Solution
f ( x ) = x - cosx
35
Part 2 SOLVING NONLINEAR EQUATION MAT 575
1
f ' (x) = + sinx
2 x
Identify initial value x0
x 0 = 1 .4
f (1.4) = 1.0132
1.0132
x1 = 1.4 −
1.4080
= 0.6804
Hence after three iterations, the estimated root is 0.642 (accurate to 3 decimal
places).
Example 2
f ( x ) = e x + x − 2 has one real root in [0, 1]. Estimate the root accurate to 3
decimal places by Newton’s method.
Solution
Identify the function f (x )
f (x) = ex + x − 2 = 0
36
Part 2 SOLVING NONLINEAR EQUATION MAT 575
f '(x) = e x + 1
x 0 = 0 .5
0.1487
x1 = 0 . 5 −
2.6487
= 0.4439
Repeat until desired iterations/accuracy
Example 3
Solution
Given
h( x ) = x 3 − x + 1
hence,
h' ( x ) = 3 x 2 − 1
37
Part 2 SOLVING NONLINEAR EQUATION MAT 575
f ( x0 )
x1 = x 0 −
f ' ( x0 )
1
= −1 −
2
= −1.5
n xn f (x ) f ' (x) 3 SD
0 -1 1 2
1 -1.5 -0.8750 5.7500 ~ -1.35
2 -1.3478 -0.1007 4.4499 ~ - 1.33
3 -1.3252 -0.0021 4.2685 ~ -1.32
4 -1.3247 0.0000 4.2646 ~ -1.32
5 -1.3247
In Chapter 1 we define percentage relative error as
x-x
ε% = x 100% , x ≠ 0 .
x
x-x
x 100
x
(-1.5) - (-1)
= x 100
− 1 .5
= 0.33
iteration xn xn+1 ε%
1 -1 -1.5 0.33
2 -1.5 -1.3478 11.29
3 -1.3478 -1.3252 1.71
4 -1.3252 -1.3247 0.04
5 -1.3247 -1.3247 0
Example 4
38
Part 2 SOLVING NONLINEAR EQUATION MAT 575
Solution
Identify the function f (x )
x3 = a
then f (x) = x 3 − a
3
x −a =0
Compute the derivative f ' ( x )
f '( x ) = 3x 2
Identify initial value;
xn
f ( xn ) = xn 3 − a f ' ( xn ) = 3xn2
Warm up exercise
Let x 3
- 2x - 5 = 0 where 2 ≤ r ≤ 3 .
(i) Identify the function f(x).
(ii) Compute the derivative f’(x).
(iii) Identify initial value x 0 .
(iv) Evaluate f(x) and f’(x) at x 0 .
(v) Apply Newton’s formula to determine the next root estimate
f ( x0 )
x1 = x 0 −
f ' ( x0 )
(vi) Continue until the third iteration and determine the root estimate.
39
Part 2 SOLVING NONLINEAR EQUATION MAT 575
CASES OF FAILURE
When the approximations produced by Newton’s method approach the desired
zero, we say that the method converges to that zero. Depending on the initial
approximation and the function, Newton’s method may not converge to the
desired zero.
y y = f(x)
x0
Figure 3.4
y y = f(x)
x1 x
x0
Figure 3.5
40
Part 2 SOLVING NONLINEAR EQUATION MAT 575
x1 x0
r x
Figure 3.6
x
r1 x0 r2 x1
y = f(x)
Figure 3.7
(e) iterations move away from zero rather than converging or simply oscillate
between two or more distinct approximations.
x2
r1 xo r2 x
x1
y = f(x)
x3
Figure 3.8
41
Part 2 SOLVING NONLINEAR EQUATION MAT 575
When using Newton’s method, consideration must be given to the proper choice
of starting point or initial value. Usually, one must have some insights as to the
shape of the function. Many times a rough graph is adequate, but in other cases
step-by-step evaluation of the function at various points may be necessary to
locate the root. Often the Bisection method is used initially to obtain a starting
point, and Newton’s method is used to improve the precision.
f(x n )
x n +1 = x n - (1)
f ' (x n )
When this is used in equation (1), the result defines the secant method:
x - xn-1
xn+1 = xn - f(xn ) n n = 1, 2, 3,... (3)
f(xn ) - f(xn-1)
42
Part 2 SOLVING NONLINEAR EQUATION MAT 575
Example 5
One of the solutions for the equation e x = 3 x 2 lies in the interval [-0.6, -0.4].
If the Secant method is used to find this root with x o = −0.6 and x1 = −0.4 ,
Solution
Identify the function : f(x)
ex = 3 x2
e x − 3x 2 = 0 ∴ f ( x) = e x − 3x 2
43
Part 2 SOLVING NONLINEAR EQUATION MAT 575
x - x0
x 2 = x1 - f(x1 ) 1
f(x1 ) - f(x 0 )
( −0.4) − ( −0.6)
= ( −0.4) − (0.1903 )
0.1903 − ( −0.5312)
= −0.4528
Repeat until desired iterations/accuracy
x 2 = −0.4528
∴ f ( x 2 ) = f ( −0.4528 ) = 0.0208
x - x1
x 3 = x 2 - f(x 2 ) 2
f(x 2 ) - f(x1 )
( −0.4528 ) − ( −0.4)
= ( −0.4528 ) − (0.0208 )
0.0208 − (0.1903 )
= −0.4593
Example 6
Let f ( x ) = ln x − x + 2 . Use the Secant method to estimate the root of f(x)
accurate to 1 decimal place if x0 = 0.1 and x1 = 0.25.
Solution
44
Part 2 SOLVING NONLINEAR EQUATION MAT 575
x - x0
x 2 = x1 - f(x1 ) 1
f(x1 ) - f(x 0 )
(0.25) − (0.1)
= 0.25 − (0.3637 )
0.3637 − ( −0.4026 )
= 0.1788 ≈ 0.2 (1D)
Repeat until desired iterations/accuracy
x - x1
x 3 = x 2 - f(x 2 ) 2
f(x 2 ) - f(x1)
(0.1788 ) − (0.25)
x 3 = 0.1788 − (0.0997 )
0.0997 − (0.3637 )
= 0.1519 ≈ 0.2 (1D )
Example 7
Let f ( x ) = x − cos x . Use the Secant method to estimate the root of f(x)
accurate to 2 significant digits if x0 = 0 and x1 = 1.
Solution
f (x) = x − cos x
xo = 0 and x1 = 1
root 2 SD
n xn-1 xn f(xn-1) f(xn)
xn+1
0 0 1 -1.0000 0.4597 0.6851 ~ 0.69
1 1 0.6851 0.4597 0.0533 0.6438 ~ 0.64
2 0.6851 0.6438 0.0533 0.0025 0.6417 ~ 0.64
Example 8
3
Determine an approximate value for 95 accurate to 3 decimal places.
45
Part 2 SOLVING NONLINEAR EQUATION MAT 575
Solution
x = 3 95
x 3 = 95
x 3 − 95 = 0
∴ f ( x ) = x 3 − 95
xo = 4 and x1 = 5
Warm up exercise
46
Part 2 SOLVING NONLINEAR EQUATION MAT 575
Exercise 3
1. Show that x3 – x – 2 = 0 has a root between 1 and 2. Using the Newton’s method
and initial point 1.5, find this root accurate to two decimal places.
2. Using the Newton’s method, solve x + ln x = 3, given that the root is close to 2.
Obtain the root correct to two decimal places.
3. Use the Newton’s method to approximate the zero of f(x) = 1 – x – x2 with initial
guess of 0.5. Give your answers accurate to 2 significant digits.
5. Use the Newton’s method to find the point in the right half-plane where the
6. Use the Newton’s method to find the zero of f(x) = (x – 2)1/3 with the initial guess
x = 3. What happens? Why?
9. Approximate the cube root of 757 given initial values 8.9 and 9.
47
Part 2 SOLVING NONLINEAR EQUATION MAT 575
11. Discuss the situations where by Newton’s method and secant method fail.
12. Show that the Newton’s formula for finding the reciprocal of A is
x n +1 = x n (2 − Ax n ) .
13. Approximate the roots of h(x) = 2x3 − 4x − 2. How many real roots does h have?
48
Part 2 SOLVING NONLINEAR EQUATION MAT 575
1. 1.5294
2. 2.2079
3. 0.6180
4. 1.7592
5. 1.67
6.
7.
8.
9. 9.1138
10. a) 0.5398
b)
11.
12.
49
Part 2 SOLVING NONLINEAR EQUATION MAT 575
1. Graphically, show that x3 + 6x – 16 = 0 has only one real root in the interval
(1, 2).
4. If a = 0.1 and b = 1.0, how many iterations of the bisection method are needed to
determine the root with an error of at most 0.5 x 10-8.
50