Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Numerical Methods (MATH-254)

Fall 2021
Lecture No. 10 (M3 Newton’s Method)

Focus

SU
- Iterative formula of Newton’s Method

- Selected exercises

M3. Newton’s Method for finding roots of a NL equation f (x) = 0:

K
The method has the following steps.

I. Locate the root(s) of f (x) = 0 (if needed so), i.e., find an interval a ≤ x ≤ b
such that f (a) and f (b) have opposite signs, i.e., f (a) f (b) < 0. Take an ap-
M
propriate initial guess p0 ∈ [a, b] for the desired root.

II. Decide/Specify a stopping criteria.


ah
III. Perform the iterations of Newton’s Method. Write down the iterative
formula of the method for the given function:
f (pN −1 )
pN = pN −1 − , N ≥ 1.
Sh

f 0 (pN −1 )
Each iteration has the following steps.

Step 1: For the first iteration, take N = 1 in the above iterative formula.
This will yield the first approximation p1 of the desired root. Find f (p1 ).
r.

Step 2: If f (p1 ) = 0 .... you are lucky, p1 is the exact root of the equation.
D

STOP! If f (p1 ) 6= 0, then check the stopping criteria. If it is satisfied then


STOP. p1 is an approximation of the root as per specified accuracy. This
completes the FIRST iteration.

IV. If the tolerance criteria is not satisfied, then take p1 as the new (initial)
guess and repeat the above 2 steps to get the second approximation p2 . Keep
repeating this process until you get the desired root or the stopping criteria

1
is satisfied.

Geometric Interpretation of Successive Approximations from New-


ton’s Method: The first approximation p1 of the root of f (x) = 0 is the
x-intercept (abscissa) of the line tangent at (p0 , f (p0 )). The second approx-
imation p2 of the root of f (x) = 0 is the x-intercept of the line tangent at
(p1 , f (p1 )), and so on. For this analogy, the Netwon(-Raphson) method is

SU
also some times called Method of Tangents.

Example 1(B): Consider the equation f (x) = cos x − x = 0. Approximate


a root of this equation by using Newton’s method. Give answer correct to 2
d.p. Use an appropriate stopping criteria.

K
Newton’s Iteration Function (Relation between the Newton’s Method
and Fixed-point Method): We can describe Newton’s method as a func-
tional iteration technique of the form pn = g(pn−1 ) where
M
g(pN −1 ) = pN −1 −
f (pN −1 )
f 0 (pN −1 )
, N ≥ 1.
ah
Example 2.23(R): Use Newton’s method to approximate, to within 10−4 ,
the value of x that produces the point on the graph of y = x2 that is closest
to (1, 0) using initial approximation x0 = 1.
Sh

Example 2.25(R): The graphs of y = 2 sin x and y = ln x + k touch each


other in the ngbhd of point x = 8. Find the value of the constant k and the
coordinates of point of contact by using x0 = 8. Use 4 d.p accuracy in your
computations.

Example 2.26(R): Successive approximations xN to the desired root are


r.

generated by the scheme


D

1 + 3x2N
xN +1 = , N ≥ 0.
4 + x3N
0
Find f (xN ) and f (xN ) and then use the Newton’s method to find the ap-
proximation of the root accurate to 10−2 , starting with x0 = 0.5.

2
3 2

2 1
f(x)
1 0 g(x)

0 -1
f(x)
g(x)
-1 -2

-2 -3

-3 -4

-4 -5

-5 -6

SU
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
x x

(a) Graph of y = 2 sin x and y = ln x − 0.0568 (b) Graph of y = 2 sin x and y = ln x − 0.5
3

1
f(x)

K
g(x)
0

-1

-2

-3

-4

-5
0 1 2 3

M
4

(c) Graph of y = 2 sin x and y = ln x + 0.5

Figure 1: Example 2.25(R): Graph of y = 2 sin x and y = ln x+k for different


x
5 6 7 8 9

k.
ah

Example 2.29(R): Develop the iterative formula

x2N −1 − b
Sh

xN = , N ≥1
2xN −1 − a

for the appropriate roots of the quadratic equation x2 − ax + b = 0 using


Newton’s method. Then use the formula to find the third approximation of
the positive root of the equation x2 − 3x − 4 = 0 starting with x0 = 3.5.
r.

Relevant Questions: Examples 2.24(R), 2.27(R), 2.28(R), 2.30(R), 2.31(R),


D

Qs. 9, 10, 11, 12

Remark I (Convergence of Newton’s Method to a Different Root:)


Given cos x = 0. Start with x0 = 3, apply Newton’s method and check the
convergence of the sequence {xN }∞
N =1 .

Remark II (Divergence of Newton’s Method:) Given x e−x = 0. Start

3
with x0 = 2, apply Newton’s method and check the convergence of the se-
quence {xN }∞
N =1 .

Remark III (Importance of Initial Guess): Consider x3 − x − 3 = 0.


Apply Newton’s method with (a) x0 = 2, and (a) x0 = 0 to approximate the
root of this equation in [1.5, 2].

SU
Advantages of Newton’s Method:

(i) Newton’s method usually converges very well and fast/quickly provided
the initial guess is sufficiently closed to the desired root.

K
(ii) Newton’s method is not restricted to just one-dimension. It can be ex-
tended/generalized to multiple dimensions (more variable cases). We will use
it for approximation of roots of systems of NL equations later in this chapter.

M
(iii) This method can be used to approximate both the real and imaginary
roots of the polynomial equations.

Dis-advantages of Newton’s Method:


ah
(i) Convergence of Newton’s method to the desired root is not guaranteed.
This method sometimes converge to a different root than the desired one. In
particular, this may happen when the initial guess in not sufficiently close to
Sh

the desired root.

(ii) Another advantage of the method is that differentiation of some functions


is difficult or some functions can’t be differentiated analytically.
r.

0
(iii) The method fails if f (pN −1 ) = 0, for some N ≥ 1.

Next Lecture: (M4) Secant Method


D

4
Numerical Methods (MATH-254)
Lecture No. 11 (M4. Secant Method)

Focus

- Iterative formula of Secant Method

SU
- Selected exercises

M4 Secant Method for finding roots of a NL equation f (x) = 0: The


method has the following steps.

K
I. Locate the root(s) of f (x) = 0 (if needed), i.e., find an interval a ≤ x ≤ b
such that f (a) and f (b) have opposite signs, i.e., f (a) f (b) < 0. Take any
two appropriate initial guesses p0 and p1 such that p0 6= p1 , for the desired
root.

II. Decide/Specify a stopping criteria.


M
III. Write down the iterative formula of the method for the given function:
ah
(pN −1 − pN −2 )f (pN −1 )
pN = pN −1 − , N ≥ 2.
f (pN −1 ) − f (pN −2 )
Sh

Each iteration has the following steps.

Step 1: For the first iteration, take N = 2 in the above iterative formula.
This will yield the first approximation p2 of the desired root. Find f (p2 ).
r.

Step 2: If f (p2 ) = 0 .... you are lucky, p2 is the exact root of the equation.
STOP! If f (p2 ) 6= 0, then check the stopping criteria. If it is satisfied then
STOP. p2 is an approximation of the root as per specified accuracy. This
D

completes the FIRST iteration.

IV. If the stopping criteria is not specified, then take p1 and p2 as the new
(initial) guesses and repeat the above 2 steps to get the second approximation
p3 . Keep repeating this process until the stopping criteria is satisfied.

5
Remark: A simpler form of the iterative formula of Secant method ids given
by
pN −2 f (pN −1 ) − pN −1 f (pN −2 )
pN = , N ≥ 2.
f (pN −1 ) − f (pN −2 )
Geometric Interpretation of Successive Approximations from Se-
cant Method: The first approximation p2 of the root of f (x) = 0 is the x-
intercept of the Secant line connecting (p0 , f (p0 )) and (p1 , f (p1 )). The second

SU
approximation p3 of the root of f (x) = 0 is the x-intercept of the secant line
joining (p1 , f (p1 )) and (p2 , f (p2 )), and so on. For this analogy, this method
is called Secant Method.

K
Example 2.34(R) (The simplest question) Use the secant method to
find the approximate root of the equation x3 − 2x − 1 = 0 accurate to 10−2 .
Take initial approximations p0 = 1.5 and p1 = 2.

M
Example 2.32(R) Show that the iterative procedure for evaluating the re-
ciprocal of a number N by using the secant method is

pn+1 = pn + (1 − N xn )xn−1 , n≥1


ah
Hence, find an approximation of the reciprocal of N = 7 correct to 2 d.p.
(use appropriate initial guesses).

Example 2.36(R) Show that the x-coordinate of the intersection point of


Sh

the plane curves f (x) = x3 +2x−1 and g(x) = sin x lies between [0.5, 1]. Find
its approximate value by using Secant method, correct to 3 d.p. starting with
p0 = 0.5 and p1 = 0.55. Use RE as stopping criteria |xN|x+1N +1
−xN |
| < 10−3 = .
Hence, find the intersection point.
r.

Relevant Questions: Examples 2.33(R), 2.35(R), Qs. 13-15,


D

Next Lecture: Multiple roots and the modified Newton’s Method

6
Numerical Methods (MATH-254)
Lecture No. 12 (Multiple roots and the modified Newton’s Method)

Focus

- Multiple roots of NL equations f (x) = 0

SU
- First and Second Modified Newton’s Method

Definition 2.4R: (Order of Multiplicity of a Multiple Root) The


equation f (x) = 0 has a root α of order m if there exists a continuous

K
function h(x), such that f (x) can be expressed as
f (x) = (x − α)m h(x).
Then h(x) can be used to obtain the remaining roots of f (x) = 0. It is called
M
polynomial deflation. The following Lemma provides an easy practical pro-
cedure for determining the order of multiplicity of roots of a function.
0 00
Lemma 2.2R: Assume that function f (x) and its derivatives f (x), f (x), · · ·
ah
f (m) (x) are defined and continuous on an interval about x = α. Then
f (x) = 0 will have a root α of order m iff
0 00
f (α) = f (α) = f (α), · · · f (m−1) (α) = 0, and f (m) (α) 6= 0.
Sh

Examples (Order of Multiplicity of Roots of NL Equations): Con-


sider the following examples.

(i). Given x3 − x2 − 21x + 45 = 0. Show that α1 = −5 and α2 = 3 are roots


of this NL equation with multiplicities one and two, respectively.
r.

(ii). Given x ln x − ln x = 0. Find the multiplicity of the root α = 1 of this


D

NL equation.

Example 2.38R Consider the following two nonlinear equations


(i). x ex = 0, (ii). x2 ex = 0,
(i) Write down the Newton’s method for approximating the solution of the
given equations. Find two approximations of the roots of these equations

7
correct to 3 d.p., starting from x0 = 0.5.

(ii) Explain why one of the sequence converges much faster than the other to
the root p∗ = 0?

Related Exercises: Example 2.38R, Qs. 16, 17

SU
100
1.6
80
1.4
60
1.2
40 1

20 0.8

0 0.6

K
-20 0.4

-40 0.2

0
-60
-0.2
-80
-0.4
-100
-6 -4 -2 0 2 4 6 0 0.5 1 1.5 2 2.5
x x

(a) Graph of y = x3 − x2 − −21x + 45


10

7
M (b) Graph of f (x) = x ln x − ln x

6
ah
5

4 f(x)
g(x)
3

-1
Sh

-2 -1.5 -1 -0.5 0 0.5 1 1.5 2


x

(c) Graphs of g(x) = x ex and f (x) = x2 ex

Figure 2: Example 2.38R: Graph of some functions to show multiplicities of


their zeros
r.

Remark: Newton’s method can be used to approximate the multiple root(s)


but sometimes the convergence will be slow and sometimes it may not con-
D

verge. Therefore, some modifications are made to maintain the rate of con-
vergence and to address the issue of divergence. The following two modified
versions of the Newton’s method addresses these issues.

First Modified Newton’s (or Schroeder’s) Method Suppose m is the


multiplicity of a root α of the NL equation f (x) = 0. Then it can be approx-

8
imated by the first modified Newton’s method given by the iterative formula
f (xN −1 )
xN = xN −1 − m , N = 1, 2, 3, · · ·
f 0 (xN −1 )

Example 2.39R: Show that the nonlinear equation 1 − 2 cos x + cos2 x = 0


has a root α = 0. Find its order of multiplicity. Develop the First Modified

SU
Newton’s formula for computing this root, then use it to find the second ap-
proximation starting with an initial approximation x0 = 0.5. Show that the
developed formula converges fast.

Example 2.41R: Show that x5 − 8x4 + 25x3 − 38x2 + 28x − 8 = 0 has a triple

K
root at α = 2. Write down the first modified Newton’s iterative formula for
this NL equation and approximate x3 using x0 = 2.3. Give answer correct to
3 d.p.

M
Exercise: Show that α = 1 is the multiple root of the nonlinear equation
1 = xe1−x . Use modified Newton’s method to find the second approximation
of the root by using x0 = 0.75. Compute RE.
ah
Second Modified Newton’s Method Suppose m is the multiplicity of a
root α of the NL equation f (x) = 0 and it is not known. Then the root
can be approximated by the second modified Newton’s method given by the
iterative formula
Sh

0
f (xN −1 )f (xN −1 )
xN = xN −1 − , N = 1, 2, 3, · · ·
(f 0 (xN −1 ))2 − f (xN −1 ) f 00 (xN −1 )

This formula is obtained/derived from Newton’s method by replacing f (x)


with ff0(x) .
r.

(x)

Example 2.42R: Find the multiplicity of the roots of the equation 1−cos x =
D

0. Use the Newton’s method and Newton’s first and second modified meth-
ods to find the first two approximations of the root α = 0 of the equation,
starting from x0 = 0.1 and correct upto 3 d.p. Discuss the answers you have
obtained from the 3 methods.

Example 2.43R: The equation x3 −5x2 +7x−3 = 0 has roots 1 and 3. Find
the multiplicity of these roots. Use Newton’s method and Newton’s first and

9
second modified methods to find the first two approximations of these roots,
starting from x0 = 4 for α1 = 3 and start from x0 = 0 for α1 = 1. Give
answers correct to 3 d.p.

Related Exercises: Examples(R) 2.36, 2.44,

Next Lecture: Error/Convergence Analysis: Order of Convergence of Func-

SU
tional Iteration Schemes
∗∗
Last updated on September17, 2021

K
M
ah
Sh
r.
D

10

You might also like