Numerical Analysis: Chapter Finding Zeros: Nguyen Duc Manh
Numerical Analysis: Chapter Finding Zeros: Nguyen Duc Manh
Finding Zeros
21/08/2024 2
Bisection Method
Idea : Suppose that f is continuous on the interval [a, b] and f(a)f(b) < 0.
Start with ∆0 = [a, b], then divide ∆0 with its middle point and choose ∆1
= [a1, b1] which is one of two subintervals of ∆0 such that f(a1)f(b1) < 0.
Again this interval ∆1 is divided and choose the subinterval ∆2
containing the solution and so on. More precisely, at the step n we have
a sequence of intervals satisfying:
D 0 É D1 É ... É D n = [ a n , b n ] , f(a n )f(b n ) < 0,
b-a
bn - a n = n
® 0.
2
Note that {an} inscreases and is bounded from above by b, and {bn}
descreases and is bounded from below by a. Moreover, bn – an → 0,
thus a , b ® x.
n n
Since f(a n )f(bn ) < 0, when n ® ¥, we have ( f(x ) ) £ 0 . Thus x
2
is
the solution of the equation.
If we stop the process at the step n, and take the middle point of ∆n to
be an approximate solution then the error is
a n +b n b-a
ξ- £ n+1 ® 0
21/08/2024 2 2 3
Bisection Method
Example : Find the solution of this equation on the interval [0, 1]:
f(x) := x 4 + 2 x3 - x - 1 = 0
f(0) = -1, f(1)=1,Δ 0 = [ 0,1]
f(0,5) = -1,19 Þ Δ1 = [ 0,5;1]
f(0,75) = -0,59 Þ Δ 2 = [ 0,75;1]
f(0,875) = 0,05 Þ Δ 3 = [ 0,75;0,875]
f(0,8125) = -0,304 Þ Δ 4 = [ 0,8125;0,875]
f(0,8438) = -0,135 Þ Δ 5 = [ 0,8438;0,875]
f(0,8594) = 0,043 Þ Δ 6 = [ 0,8438;0,8594]
If we stop at the step 6 and take the middle point of ∆6 to be an
approximate solution, then the error is
21/08/2024 5
Iterative Method
Theorem: If the function φ is twice differentiable on [a, b] and such
that:
[ ]
i) "x Î a, b , φ'(x) £ q < 1.
Remark: the conditions i) and ii) mean that the functionφ is a contraction
mapping on the interval [a, b]. The theorem above is just a special case
of the Banach fixed-point theorem for a contraction mapping on a non-
empty complete metric space.
21/08/2024 6
Iterative Method
Remark:
- The formula (2) is used to estimate the solution in advance,
specifically to calculate the number of iterations necessary to
achieve the desired accuracy.
21/08/2024 7
Iterative Method
Example : Find the solution of the following equation on [9, 10]:
f(x) = x 3 + x - 1000 = 0.
Solution: we can transform this equation into the three equivalent
forms as follows :
a) x = φ1 (x) = 1000 - x 3
1000 1
b) x = φ 2 (x) = 2
-
x x
c) x = φ3 (x) = 3 1000 - x
Thus we have:
a) φ'1 (x) = -3x 2 Þ max φ'1 (x) = 300 > 1.
9£ x £10
1 1
21/08/2024
c) φ'3 (x) = - (1000 - x) -2/3 Þ max φ'3 (x) » !1 8
3 9£ x £10 300
Iterative Method
If we use the iterative method for the functions φ1 , φ 2 then the
sequence xk is not sure to converge; while if use the function φ 3 to
create the sequence xk, then the sequence converges to the solution
quickly.
On the other hand, it is easy to check that φ 3 maps [9, 10] into [9, 10].
We thus construct the sequence of xk as follows :
x0 = 10;
x1 = φ3 (x 0 ) = 9,96655;
x 2 = φ3 (x1 ) = 9,96666;
x 3 = φ3 (x 2 ) = 9,96667.
If we choose x3 to be an approximate solution, the error is:
q 0,0001
x3 - x £ x3 - x 2 » = 3,33.10-7.
(1 - q) 300
21/08/2024 9
Interpolation Method
(the regula falsi method, method of false position, or false position method)
1) The equation f(x) = 0 has unique solution on the interval [a, b].
[ ]
2) f Î C2 a, b , and f’, f’’ do not change the sign on [a, b].
Without loss of generality in what following, we can suppose that f’’ > 0
on [a, b]. (i.e., f is a convex function on [a, b]).
21/08/2024 10
Interpolation Method
(the regula falsi method, method of false position, or false position method)
21/08/2024 11
Interpolation Method
(the regula falsi method, method of false position, or false position method)
21/08/2024 12
Interpolation Method
(the regula falsi method, method of false position, or false position method)
[
1) If f ¢(x) ³ m > 0,"x Î a, b ,]
f(x k )
x k -ξ £
m
2) If f’ does not change sign on [a, b] and
0 < m £ f ¢(x) £ M ,"x Î [a, b] ,
then
M-m
x k+1 - ξ £ x k+1 - x k .
m
8/21/24 13
Interpolation Method
(the regula falsi method, method of false position, or false position method)
Example: Calculate the value of 3
Solution : Consider the equation on [0, 3]
x2 = 3
It is easy to see that f(x) = x2 – 3 satisfies all condition of the
interpolation method on the interval [0, 3]. Take x0 = 0, and construct
the sequence xk as follows
f(x k ) x 2k - 3
x k+1 = x k - (x k - b) = x k - 2 (x k - 3)
f(x k ) - f(b) xk - 9
3(x k + 1)
= ×
xk + 3
Thus :
x1 = 1; x6 = 1,7307692;
x2 = 1,5; x7 = 1,7317070;
x3 = 1,666667; x8 = 1,7319587;
x4 = 1,71428571; x9 = 1,7320261;
21/08/2024
x5 = 1,72727272; x = 1,7320508. 14
Secant Method
We create the sequence {xk} as follows:
y
x x3
x2 x1 x0 x
If the initial values are not close enough to the root, then there is no
guarantee that the secant method converges. There is no general
definition of "close enough", but the criterion has to do with how "wiggly"
the function is on the interval [x0, x1]. For example, if f is differentiable on
that interval and there is a point where f’ = 0 on the interval, then the
algorithm may not converge.
21/08/2024 16
Convergence speed for iterative methods
In numerical analysis, the order of convergence and the rate of
convergence of a convergent sequence are quantities that represent
how quickly the sequence approaches its limit.
Definition: A sequence {xn} that converges to x* is said to have order of
convergence q ≥ 1and rate of convergence μ if
21/08/2024 19
Convergence speed for iterative methods
In order to further classify convergence, the order of convergence is
defined as follows. The sequence is said to converge with order q to L for
q ≥ 1 if
for some positive constant M > 0 (not necessarily less than 1 if q > 1). In
particular, convergence with order:
• q = 1 is called linear convergence (if M < 1),
• q = 2 is called quadratic convergence,
• q = 3 is called cubic convergence,
• etc.
1) The equation f(x) = 0 has unique solution on the interval [a, b].
2) f Î C2 [a, b], and f’, f’’ do not change the sign on [a, b].
y
Method: choose a point x0 f(b) B
in the interval [a, b] which is
Fourrier point, that is :
f(x 0 )f ¢¢(x 0 ) > 0.
Construct the sequence xk : b
f(x k ) a x
x k+1 = x k - , k ³ 0. x
f ¢(x k ) x2 x1 x0
f(a)
A
This is a monotone sequence which converges to the solution x of the
equation.
21/08/2024 21
Newton’s Method
Error: if
M1 2
x k+1 -ξ £ x k+1 - x k .
2M 2
8/21/24 22
Newton’s Method
Example: Calculate the value of 3