You are on page 1of 87

NONLINEAR EQUATION

ELECTRONIC LECTURE

Hoang Hai Ha
HCMUT-OISP
Email: hoanghaiha@hcmut.edu.vn

TP. HCM — 2021.

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 1 / 34


MOTIVATION

The equation f (x) = ax 2 + bx + c = 0 can be solved


directly.

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 2 / 34


MOTIVATION

The equation f (x) = ax 2 + bx + c = 0 can be solved


directly.

The growth of population in America is described by


435 λ
model: N (t ) = 1000e λ +(e − 1), where N (t ) is the
λ
number of population in time t and λ is the constant
birthrate of population. Suppose that in 2001,
population contains 1000,000 people, find the
birthrate in this year.

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 2 / 34


MOTIVATION

The equation f (x) = ax 2 + bx + c = 0 can be solved


directly.

The growth of population in America is described by


435 λ
model: N (t ) = 1000e λ +(e − 1), where N (t ) is the
λ
number of population in time t and λ is the constant
birthrate of population. Suppose that in 2001,
population contains 1000,000 people, find the
birthrate in this year.
The aim of this chapter is solving approximately
nonlinear equations, which we cannot solve exactly.
Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 2 / 34
ISOLATED INTERVAL CONTAINING ROOT

THEOREM 0.1
Given an equation f (x) = 0 and an interval [a, b]. If
f (x) is continous on [a, b], f (a). f (b) < 0 and f is
monotone on [a, b], then equation f (x) = 0 has a
unique real root on [a, b].

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 3 / 34


ISOLATED INTERVAL CONTAINING ROOT

THEOREM 0.1
Given an equation f (x) = 0 and an interval [a, b]. If
f (x) is continous on [a, b], f (a). f (b) < 0 and f is
monotone on [a, b], then equation f (x) = 0 has a
unique real root on [a, b].

There are 2 methods to determine the number of


intervals containing root:

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 3 / 34


ISOLATED INTERVAL CONTAINING ROOT

THEOREM 0.1
Given an equation f (x) = 0 and an interval [a, b]. If
f (x) is continous on [a, b], f (a). f (b) < 0 and f is
monotone on [a, b], then equation f (x) = 0 has a
unique real root on [a, b].

There are 2 methods to determine the number of


intervals containing root:
Analytical method

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 3 / 34


ISOLATED INTERVAL CONTAINING ROOT

THEOREM 0.1
Given an equation f (x) = 0 and an interval [a, b]. If
f (x) is continous on [a, b], f (a). f (b) < 0 and f is
monotone on [a, b], then equation f (x) = 0 has a
unique real root on [a, b].

There are 2 methods to determine the number of


intervals containing root:
Analytical method
Geometrical method

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 3 / 34


EXAMPLE 0.1
Determine all isolated intervals containing root of the
following equations:
x 3 − 6x + 2 = 0
ex − x2 = 0

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 4 / 34


ERROR

THEOREM 0.2 (GENERAL FORMULA OF ERROR OF ROOT


EQUATION )
Suppose that f (x) is continuous and differential on
[a, b] and ∀x ∈ [a, b], | f 0 (x)| Ê m > 0. If equation f (x) = 0
has approximate root x ∗ and exact root x , then the
absolute error ∆x ∗ of x ∗ is:
| f (x ∗ )|

|x − x| É = ∆x ∗
m

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 5 / 34


EXAMPLE 0.2
Suppose that the equation f (x) = x 3 − 5x 2 + 12 = 0 has
approximate solution x ∗ = −1.37 on [−2, −1]. Estimate
the error of x ∗ , rounding to 4 decimal digits.

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 6 / 34


THE BISECTION METHOD

THE BISECTION METHOD


Let equation f (x) = 0 have one real root on [a, b].

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 7 / 34


THE BISECTION METHOD

THE BISECTION METHOD


Let equation f (x) = 0 have one real root on [a, b].
a0 + b0
Set a0 = a, b0 = b, x 0 = , d0 = b0 − a0
2

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 7 / 34


THE BISECTION METHOD

THE BISECTION METHOD


Let equation f (x) = 0 have one real root on [a, b].
a0 + b0
Set a0 = a, b0 = b, x 0 = , d0 = b0 − a0
2
If f (x 0 ) = 0, we done. If not, there are 2 cases: if
f (a 0 ) f (x 0 ) < 0, then let a 1 = a 0 , b 1 = x 0 , otherwise,
set a1 = x 0 , b1 = b0 and x 1 = (a1 + b1 )/2

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 7 / 34


THE BISECTION METHOD

THE BISECTION METHOD


Let equation f (x) = 0 have one real root on [a, b].
a0 + b0
Set a0 = a, b0 = b, x 0 = , d0 = b0 − a0
2
If f (x 0 ) = 0, we done. If not, there are 2 cases: if
f (a 0 ) f (x 0 ) < 0, then let a 1 = a 0 , b 1 = x 0 , otherwise,
set a1 = x 0 , b1 = b0 and x 1 = (a1 + b1 )/2
reapply the process on [a1 , b1 ], [a2 , b2 ], ....., [an , bn ]
At the n t h step, we get:
an + bn


 an É x É bn , an É xn = É bn
2
 f (a n ). f (b n ) < 0, d n = b n − a n = b − a

2n
And x n is the approximate
Hoang Hai Ha (BK TPHCM)
solution of equation.
NONLINEAR EQUATION TP. HCM — 2021. 7 / 34
THE BISECTION METHOD

THE ERROR OF SOLUTION

THEOREM 1.1
Let function f (x) is continous on [a, b] and
f (a) f (b) < 0. Then bisection method generates a
sequence {x n } that converges to the exact solution x of
equation f (x) = 0 with the error:
¯ ¯
¯ an + bn ¯ 1 b−a
|x n − x| = ¯¯ − x ¯¯ É (b n − a n ) = n+1 .
2 2 2

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 8 / 34


THE BISECTION METHOD

EXAMPLE 1.1
Let the equation f (x) = 5x 3 − cos 3x = 0 have a root on
[0, 1]. Using bisection method to find x 4 and estimate
its error by two formulas.

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 9 / 34


THE BISECTION METHOD

EXAMPLE 1.1
Let the equation f (x) = 5x 3 − cos 3x = 0 have a root on
[0, 1]. Using bisection method to find x 4 and estimate
its error by two formulas.

x 4 = 0.40625; ∆x4 = 0.0313.

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 9 / 34


THE BISECTION METHOD

EXAMPLE 1.2
p
Let the equation f (x) = x − cos x = 0 have a root on
[0, 1]. Using bisection method to find x 4 and find its
error.

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 10 / 34


THE BISECTION METHOD

EXAMPLE 1.2
p
Let the equation f (x) = x − cos x = 0 have a root on
[0, 1]. Using bisection method to find x 4 and find its
error.
x 4 = 0.56625; ∆x4 = 0.0313.

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 10 / 34


THE BISECTION METHOD

EXAMPLE 1.3
Let the equation f (x) = x − tan x = 0 have a root on
[4, 4.5]. Using bisection method to find approximate
solution which has error less than 10−2 .

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 11 / 34


THE BISECTION METHOD

EXAMPLE 1.3
Let the equation f (x) = x − tan x = 0 have a root on
[4, 4.5]. Using bisection method to find approximate
solution which has error less than 10−2 .
Find the least value n ∈ N such that
4.5 − 4
∆xn = n+1 < 10−2 .
2

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 11 / 34


THE BISECTION METHOD

EXAMPLE 1.3
Let the equation f (x) = x − tan x = 0 have a root on
[4, 4.5]. Using bisection method to find approximate
solution which has error less than 10−2 .
Find the least value n ∈ N such that
4.5 − 4
∆xn = n+1 < 10−2 .
2
n = 5.

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 11 / 34


THE BISECTION METHOD

EXAMPLE 1.3
Let the equation f (x) = x − tan x = 0 have a root on
[4, 4.5]. Using bisection method to find approximate
solution which has error less than 10−2 .
Find the least value n ∈ N such that
4.5 − 4
∆xn = n+1 < 10−2 .
2
n = 5.
x 5 = 4.4921875.

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 11 / 34


FIXED POINT ITERATION METHOD

FIXED POINT METHOD

DEFINITION 2.1
The point x is called fixed point of function g if
g (x) = x

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 12 / 34


FIXED POINT ITERATION METHOD

FIXED POINT METHOD

DEFINITION 2.1
The point x is called fixed point of function g if
g (x) = x

From a given equation f (x) = 0, we always can define


the equivalent equation x = g (x) in many ways.

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 12 / 34


FIXED POINT ITERATION METHOD

EXAMPLE 2.1
Given the equation x 3 − x − 1 = 0 , we can write:
x = x3 − 1

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 13 / 34


FIXED POINT ITERATION METHOD

EXAMPLE 2.1
Given the equation x 3 − x − 1 = 0 , we can write:
x = x3 − 1
p
3
x = 1+x

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 13 / 34


FIXED POINT ITERATION METHOD

EXAMPLE 2.1
Given the equation x 3 − x − 1 = 0 , we can write:
x = x3 − 1
p
3
x = 1+x
1 1
x= + 2
x x

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 13 / 34


FIXED POINT ITERATION METHOD

EXAMPLE 2.1
Given the equation x 3 − x − 1 = 0 , we can write:
x = x3 − 1
p
3
x = 1+x
1 1
x= + 2
x x

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 13 / 34


FIXED POINT ITERATION METHOD

THEOREM 2.1
If g (x) is differentiable on [a, b], moreover

max |g 0 (x)| < 1


[a b]

then g has exactly one fixed point on [a, b]. Function g


is called contraction mapping.

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 14 / 34


FIXED POINT ITERATION METHOD

THEOREM 2.1
If g (x) is differentiable on [a, b], moreover

max |g 0 (x)| < 1


[a b]

then g has exactly one fixed point on [a, b]. Function g


is called contraction mapping.

EXAMPLE 2.2
Show that g (x) = (x 2 − 1)/3 has a unique fixed point on
the interval [−1, 1].

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 14 / 34


FIXED POINT ITERATION METHOD

FIXED-POINT ITERATION

Choose an initial value x 0 ∈ [a, b].


Construct the sequence by x n = g (x n−1 ).

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 15 / 34


FIXED POINT ITERATION METHOD

CONDITION FOR CONVERGENCE

THEOREM 2.2
Function g is differentiable on [a, b] and
q = |g 0 (x)| < 1, ∀x ∈ [a, b], then for any x 0 ∈ [a, b], the
sequence defined by x n = g (x n−1 ) converges to the
unique fixed point x of g (x) in [a, b]
Proof
THEOREM 2.3
Mean value theorem
Function f (x) is differential on [a, b], then there exist a point c in
(a,b) such that:
f (b) − f (a) = f 0 (c)(b − a)

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 16 / 34


FIXED POINT ITERATION METHOD

Applying the Mean value theorem


|x n − x| = |g (x n−1 ) − g (x)| = |g 0 (ζ1 )||x n−1 − x|
= |g 0 (ζ1 )||g (x n−2 ) − g (x)|
= |g 0 (ζ1 )||g 0 (ζ2 )||x n−2 − x|
≤ q 2 |x n−2 − x|.... ≤ q n |x 0 − x|.

Then lim x n = x .
n→∞

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 17 / 34


FIXED POINT ITERATION METHOD

ERROR ESTIMATION

Priori error
qn
|x n − x| ≤ |x 1 − x 0 |.
1−q

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 18 / 34


FIXED POINT ITERATION METHOD

ERROR ESTIMATION

Priori error
qn
|x n − x| ≤ |x 1 − x 0 |.
1−q
Posteriori error
q
|x n − x| ≤ |x n − x n−1 |.
1−q

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 18 / 34


FIXED POINT ITERATION METHOD

EXAMPLE 2.3
5x 3 + 3
Let the equation x = = g (x) have a root on (0, 1).
20
Find the approximate solution x 3 by fixed point
iteration method and its error by two formulas, x 0 is
the midpoint on (0, 1).

SOLUTION

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 19 / 34


FIXED POINT ITERATION METHOD

EXAMPLE 2.3
5x 3 + 3
Let the equation x = = g (x) have a root on (0, 1).
20
Find the approximate solution x 3 by fixed point
iteration method and its error by two formulas, x 0 is
the midpoint on (0, 1).

SOLUTION
1 x 0 = 0.5 → x 1 = 29/160 → x 2 = 0.151489(A) → x 3 = 0.150869(B )

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 19 / 34


FIXED POINT ITERATION METHOD

EXAMPLE 2.3
5x 3 + 3
Let the equation x = = g (x) have a root on (0, 1).
20
Find the approximate solution x 3 by fixed point
iteration method and its error by two formulas, x 0 is
the midpoint on (0, 1).

SOLUTION
1 x 0 = 0.5 → x 1 = 29/160 → x 2 = 0.151489(A) → x 3 = 0.150869(B )
q = max ¯ 3 x 2 ¯ = 3 (M )
¯ ¯
2
x∈[0, 1] 4 4

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 19 / 34


FIXED POINT ITERATION METHOD

EXAMPLE 2.3
5x 3 + 3
Let the equation x = = g (x) have a root on (0, 1).
20
Find the approximate solution x 3 by fixed point
iteration method and its error by two formulas, x 0 is
the midpoint on (0, 1).

SOLUTION
1 x 0 = 0.5 → x 1 = 29/160 → x 2 = 0.151489(A) → x 3 = 0.150869(B )
q = max ¯ 3 x 2 ¯ = 3 (M )
¯ ¯
2
x∈[0, 1] 4 4

q3
3 Priori error: ∆x 3 = 1−q |x 1 − x 0 | ≈ 0.5379

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 19 / 34


FIXED POINT ITERATION METHOD

EXAMPLE 2.3
5x 3 + 3
Let the equation x = = g (x) have a root on (0, 1).
20
Find the approximate solution x 3 by fixed point
iteration method and its error by two formulas, x 0 is
the midpoint on (0, 1).

SOLUTION
1 x 0 = 0.5 → x 1 = 29/160 → x 2 = 0.151489(A) → x 3 = 0.150869(B )
q = max ¯ 3 x 2 ¯ = 3 (M )
¯ ¯
2
x∈[0, 1] 4 4

q3
3 Priori error: ∆x 3 = 1−q |x 1 − x 0 | ≈ 0.5379
q q
4 Posterrior error: ∆x 3 = 1−q |x 3 − x 2 | = 1−q |B − A| ≈ 0.0019

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 19 / 34


FIXED POINT ITERATION METHOD

EXAMPLE 2.4
Using fixed-point iteration method, find the
approximate solution x 3 of the equation
5
x = 3+ = g (x) on [3, 4] with x 0 = 3.5 and its priori
x2
error .

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 20 / 34


FIXED POINT ITERATION METHOD

EXAMPLE 2.4
Using fixed-point iteration method, find the
approximate solution x 3 of the equation
5
x = 3+ = g (x) on [3, 4] with x 0 = 3.5 and its priori
x2
error .
ANS
x 3 = 3.4248799, ∆x 3 = 0.0074103

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 20 / 34


FIXED POINT ITERATION METHOD

EXAMPLE 2.5
Using fixed point method,
p
find the approximate root
3
x 3 for equation x = x + 1 = g (x) on [1, 2] with x 0 = 1.5
and compute its posteriori error. Find the least
number of steps of calculation to get the solution
whose priori error less then 10−3 .

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 21 / 34


FIXED POINT ITERATION METHOD

EXAMPLE 2.5
Using fixed point method,
p
find the approximate root
3
x 3 for equation x = x + 1 = g (x) on [1, 2] with x 0 = 1.5
and compute its posteriori error. Find the least
number of steps of calculation to get the solution
whose priori error less then 10−3 .
q n
Priori error ∆xn ≈ 1−q |x 1 − x 0 | < 10−3 ⇒
n 10−3 (1 − q) 10−3 (1 − q)
q < ⇒ n > l og q
|x 1 − x 0 | |x 1 − x 0 |

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 21 / 34


FIXED POINT ITERATION METHOD

EXAMPLE 2.6
Given function x 4 + 2x 2 − x − 3 = 0. Transform it to the
equivalent equation x = g (x) in two case below
p
4
x= 3 + x − 2x 2
3x 4 + 2x 2 + 3
x=
4x 3 + 4x − 1
With initial value x 0 = 1, which case give us better
approximate solution?

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 22 / 34


FIXED POINT ITERATION METHOD

EXAMPLE 2.6
Given function x 4 + 2x 2 − x − 3 = 0. Transform it to the
equivalent equation x = g (x) in two case below
p
4
x= 3 + x − 2x 2
3x 4 + 2x 2 + 3
x=
4x 3 + 4x − 1
With initial value x 0 = 1, which case give us better
approximate solution?
n xn g 1 (x n ) g 2 (x n )
1 x1 1.1892 1.1429
2 x2 1.0801 1.1245
3 x3 1.1497 1.1241
4 x4 1.1078 1.1241
Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 22 / 34
Newton’s method

NEWTON’S METHOD-GEOMETRIC IDEA

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 23 / 34


Newton’s method

CONSTRUCT FORMULA

Suppose that equation f (x) = 0 has a root on [a, b].


Guess an initial value x 0

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 24 / 34


Newton’s method

CONSTRUCT FORMULA

Suppose that equation f (x) = 0 has a root on [a, b].


Guess an initial value x 0
Tangent line to f (x) at x 0 is y = f (x 0 ) + f 0 (x 0 )(x − x 0 ).

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 24 / 34


Newton’s method

CONSTRUCT FORMULA

Suppose that equation f (x) = 0 has a root on [a, b].


Guess an initial value x 0
Tangent line to f (x) at x 0 is y = f (x 0 ) + f 0 (x 0 )(x − x 0 ).
Intersection point of tangent line with x -axis is
f (x 0 ) + f 0 (x 0 )(x − x 0 ) = 0

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 24 / 34


Newton’s method

CONSTRUCT FORMULA

Suppose that equation f (x) = 0 has a root on [a, b].


Guess an initial value x 0
Tangent line to f (x) at x 0 is y = f (x 0 ) + f 0 (x 0 )(x − x 0 ).
Intersection point of tangent line with x -axis is
f (x 0 )
f (x 0 ) + f 0 (x 0 )(x − x 0 ) = 0 ⇒ x = x 0 − , then
f 0 (x 0 )
f (x 0 )
x1 = x0 − .
f 0 (x 0 )
Repeat the process to find x 2 , x 3 , .., x n .
f (x n−1 )
Generate the sequence x n = x n−1 − .
f 0 (x n−1 )
Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 24 / 34
Newton’s method

EXAMPLE 3.1
Given equation cos x − x = 0, using Newton’s method
to find approximate root on [0, π/2] after 3 iterations
with initial guess is x 0 = 0.

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 25 / 34


Newton’s method

EXAMPLE 3.1
Given equation cos x − x = 0, using Newton’s method
to find approximate root on [0, π/2] after 3 iterations
with initial guess is x 0 = 0.

SOLUTION
f = cos x − x , f 0 = − sin x − 1, set function
f (x) cos x − x
g (x) = x − 0 =x−
f (x) − sin x − 1

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 25 / 34


Newton’s method

EXAMPLE 3.1
Given equation cos x − x = 0, using Newton’s method
to find approximate root on [0, π/2] after 3 iterations
with initial guess is x 0 = 0.

SOLUTION
f = cos x − x , f 0 = − sin x − 1, set function
f (x) cos x − x
g (x) = x − 0 =x−
f (x) − sin x − 1
First iteration: x 1 = g (x 0 ) = 1

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 25 / 34


Newton’s method

EXAMPLE 3.1
Given equation cos x − x = 0, using Newton’s method
to find approximate root on [0, π/2] after 3 iterations
with initial guess is x 0 = 0.

SOLUTION
f = cos x − x , f 0 = − sin x − 1, set function
f (x) cos x − x
g (x) = x − 0 =x−
f (x) − sin x − 1
First iteration: x 1 = g (x 0 ) = 1
Second iteration: x 2 = g (x 1 ) = 0.750363867840244

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 25 / 34


Newton’s method

EXAMPLE 3.1
Given equation cos x − x = 0, using Newton’s method
to find approximate root on [0, π/2] after 3 iterations
with initial guess is x 0 = 0.

SOLUTION
f = cos x − x , f 0 = − sin x − 1, set function
f (x) cos x − x
g (x) = x − 0 =x−
f (x) − sin x − 1
First iteration: x 1 = g (x 0 ) = 1
Second iteration: x 2 = g (x 1 ) = 0.750363867840244
Third iteration: x 3 = g (x 2 ) = 0.739112890911362

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 25 / 34


Newton’s method

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 26 / 34


Newton’s method

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 26 / 34


Newton’s method

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 26 / 34


Newton’s method

• Exactly root : A = 0.739085133


• B = x 2 = 0.750363867840244
• C = x 3 = 0.739112890911362

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 26 / 34


Newton’s method

CONVERGENCE

THEOREM 3.1
The sequence x n generated by Newton’s method
converges to exact root x of function f (x) = 0 if the
following conditions satisfy:
f 0 (x) 6= 0, ∀x ∈ [a, b].

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 27 / 34


Newton’s method

CONVERGENCE

THEOREM 3.1
The sequence x n generated by Newton’s method
converges to exact root x of function f (x) = 0 if the
following conditions satisfy:
f 0 (x) 6= 0, ∀x ∈ [a, b].
f 00 (x) is continuous on [a, b].

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 27 / 34


Newton’s method

CONVERGENCE

THEOREM 3.1
The sequence x n generated by Newton’s method
converges to exact root x of function f (x) = 0 if the
following conditions satisfy:
f 0 (x) 6= 0, ∀x ∈ [a, b].
f 00 (x) is continuous on [a, b].
x 0 (initial guest) is sufficiently close to exact root x .

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 27 / 34


Newton’s method

EXAMPLE 3.2
Given equation f (x) = x 3 − 2x 2 − 5 on [−1, 4], construct
the sequence by Newton’s method with x 0 = −1 after 5
iterations.

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 28 / 34


Newton’s method

EXAMPLE 3.2
Given equation f (x) = x 3 − 2x 2 − 5 on [−1, 4], construct
the sequence by Newton’s method with x 0 = −1 after 5
iterations.
Exact root x = 2.690647448028614.
x 1 = 0.142857142857143
x 2 = −9.731428571428571
x 3 = −6.276696653150196
x 4 = −2.398586261805698
x 5 = −1.270038382108753

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 28 / 34


Newton’s method

EXAMPLE 3.2
Given equation f (x) = x 3 − 2x 2 − 5 on [−1, 4], construct
the sequence by Newton’s method with x 0 = −1 after 5
iterations.
Exact root x = 2.690647448028614.
x 1 = 0.142857142857143
x 2 = −9.731428571428571
x 3 = −6.276696653150196
x 4 = −2.398586261805698
x 5 = −1.270038382108753
⇒ Method failed
Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 28 / 34
Newton’s method

INITIAL GUESS

Consider equation f (x) = 0. Let f (x) such that


f 0 (x) > 0 or f 0 (x) < 0 on [a, b], f (a) f (b) < 0. In addition,
f 00 (x) > 0 or f 00 (x) < 0 on [a, b]. We will choose x 0 as
below:
Taking any point p in (a, b)

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 29 / 34


Newton’s method

INITIAL GUESS

Consider equation f (x) = 0. Let f (x) such that


f 0 (x) > 0 or f 0 (x) < 0 on [a, b], f (a) f (b) < 0. In addition,
f 00 (x) > 0 or f 00 (x) < 0 on [a, b]. We will choose x 0 as
below:
Taking any point p in (a, b)
If f 0 (p) f 00 (p) < 0, then choose x 0 = a .

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 29 / 34


Newton’s method

INITIAL GUESS

Consider equation f (x) = 0. Let f (x) such that


f 0 (x) > 0 or f 0 (x) < 0 on [a, b], f (a) f (b) < 0. In addition,
f 00 (x) > 0 or f 00 (x) < 0 on [a, b]. We will choose x 0 as
below:
Taking any point p in (a, b)
If f 0 (p) f 00 (p) < 0, then choose x 0 = a .
If f 0 (p) f 00 (p) > 0, then choose x 0 = b .
or

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 29 / 34


Newton’s method

INITIAL GUESS

Consider equation f (x) = 0. Let f (x) such that


f 0 (x) > 0 or f 0 (x) < 0 on [a, b], f (a) f (b) < 0. In addition,
f 00 (x) > 0 or f 00 (x) < 0 on [a, b]. We will choose x 0 as
below:
Taking any point p in (a, b)
If f 0 (p) f 00 (p) < 0, then choose x 0 = a .
If f 0 (p) f 00 (p) > 0, then choose x 0 = b .
or
If f (a) f 00 (a) > 0 then choose x 0 = a .

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 29 / 34


Newton’s method

INITIAL GUESS

Consider equation f (x) = 0. Let f (x) such that


f 0 (x) > 0 or f 0 (x) < 0 on [a, b], f (a) f (b) < 0. In addition,
f 00 (x) > 0 or f 00 (x) < 0 on [a, b]. We will choose x 0 as
below:
Taking any point p in (a, b)
If f 0 (p) f 00 (p) < 0, then choose x 0 = a .
If f 0 (p) f 00 (p) > 0, then choose x 0 = b .
or
If f (a) f 00 (a) > 0 then choose x 0 = a .
If f (b) f 00 (b) > 0 then choose x 0 = b .
Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 29 / 34
Newton’s method

ERROR

ERROR
Estimate error of approximate root x n in Newton’s
method is
| f (x n )|
|x n − x| É .
m

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 30 / 34


Newton’s method

EXAMPLE 3.3
Let the equation f (x) = x 3 − 3x + 1 = 0 have a root on
[0, 0.5]. Using Newton method, find x 3 and its error.

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 31 / 34


Newton’s method

EXAMPLE 3.3
Let the equation f (x) = x 3 − 3x + 1 = 0 have a root on
[0, 0.5]. Using Newton method, find x 3 and its error.

SOLUTION
f 0 = 3x 2 − 3, f 00 (x) = 6x

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 31 / 34


Newton’s method

EXAMPLE 3.3
Let the equation f (x) = x 3 − 3x + 1 = 0 have a root on
[0, 0.5]. Using Newton method, find x 3 and its error.

SOLUTION
f 0 = 3x 2 − 3, f 00 (x) = 6x
Taking p = 0.1 ∈ [0, 0.5], check the sign of f 0 (x) f 00 (x)
at p ,

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 31 / 34


Newton’s method

EXAMPLE 3.3
Let the equation f (x) = x 3 − 3x + 1 = 0 have a root on
[0, 0.5]. Using Newton method, find x 3 and its error.

SOLUTION
f 0 = 3x 2 − 3, f 00 (x) = 6x
Taking p = 0.1 ∈ [0, 0.5], check the sign of f 0 (x) f 00 (x)
at p , f 0 (0, 1) f 00 (0.1) < 0, then choose x 0 = 0.

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 31 / 34


Newton’s method

EXAMPLE 3.3
Let the equation f (x) = x 3 − 3x + 1 = 0 have a root on
[0, 0.5]. Using Newton method, find x 3 and its error.

SOLUTION
f 0 = 3x 2 − 3, f 00 (x) = 6x
Taking p = 0.1 ∈ [0, 0.5], check the sign of f 0 (x) f 00 (x)
at p , f 0 (0, 1) f 00 (0.1) < 0, then choose x 0 = 0.
f x 3 − 3x + 1
Consider g (x) = x − 0 = x − ,
f 3x 2 − 3

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 31 / 34


Newton’s method

EXAMPLE 3.3
Let the equation f (x) = x 3 − 3x + 1 = 0 have a root on
[0, 0.5]. Using Newton method, find x 3 and its error.

SOLUTION
f 0 = 3x 2 − 3, f 00 (x) = 6x
Taking p = 0.1 ∈ [0, 0.5], check the sign of f 0 (x) f 00 (x)
at p , f 0 (0, 1) f 00 (0.1) < 0, then choose x 0 = 0.
f x 3 − 3x + 1
Consider g (x) = x − 0 = x − , x n = g (x n−1 ).
f 3x 2 − 3

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 31 / 34


Newton’s method

x 1 0.333333
x 2 0.347222
x 3 0.347296

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 32 / 34


Newton’s method

x 1 0.333333 Estimate of error


| f (x 3 )|
x 2 0.347222 ∆x 3 ≤ ≈ 2.5443 · 10−9 ,
m
x 3 0.347296 where m = min | f 0 (x)| =
x∈[0,0.5]
0
| f (0.5)| = 9/4

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 32 / 34


Newton’s method

EXAMPLE 3.4
Given equation sin x − e −x = 0, using Newton’s method
to find approximate root on [0, 1] and estimate its
error.

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 33 / 34


Newton’s method

EXAMPLE 3.4
Given equation sin x − e −x = 0, using Newton’s method
to find approximate root on [0, 1] and estimate its
error.
SOLUTION
f 0 = cos x + e −x , f 00 = − sin x − e −x

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 33 / 34


Newton’s method

EXAMPLE 3.4
Given equation sin x − e −x = 0, using Newton’s method
to find approximate root on [0, 1] and estimate its
error.
SOLUTION
f 0 = cos x + e −x , f 00 = − sin x − e −x
since f (0) f 00 (0) > 0 so we choose x 0 = 0

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 33 / 34


Newton’s method

x1 0.5
x 2 0.585644
x 3 0.588529

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 34 / 34


Newton’s method

x1 0.5 Estimate of error


| f (x 3 )|
x 2 0.585644 ∆x 3 ≤ ≈ 6 · 10−6 ,
m
x 3 0.588529 where m = min | f 0 (x)| =
x∈[0,1]
| f (1)| = cos 1 + e −1
0

Hoang Hai Ha (BK TPHCM) NONLINEAR EQUATION TP. HCM — 2021. 34 / 34

You might also like