Numerical Methods Chapter 1
Numerical Methods Chapter 1
INTRODUCTION
In this chapter, we will discuss the solution of a nonlinear single-variable equation. It is about
finding the value of x that satisfies the equation f (x) = 0. For a function f , x is called the
zero or the root of the equation f (x) = 0.
Example:
Separate the roots of the equation x3 − 3x + 1 = 0 in the interval [−3, 3].
Chapter 1 Resolution of non-linear equations f (x) = 0. 2
• f (−3) = −17, f (3) = 19, therefore f (−3) · f (3) < 0. According to the Intermediate
Value Theorem, there exists at least one root α of f (x) = 0 in [−3, 3].
• To study the uniqueness of the root α, let us examine the monotonicity of f (x).
f (x) = x3 − 3x + 1
- Sign Table:
There will be three intersections between the graphs of g and h, so there are three roots:
• Ensure that f (a) · f (b) < 0, which guarantees that a root lies in the interval.
5. Stop:
Example
Find the root of x4 + 2x3 − x − 1 = 0 in the interval [0, 1] with a precision of 0.05.
f (0) = −1, f (1) = 1. Since f (0) · f (1) < 0, a root exists in [0, 1].
Conditions of Convergence:
1) f (0) · f (1) < 0
2) f is continuous on [0, 1]
3) f is strictly increasing on [0, 1]
|b−a|
n a b c f (c) 2
|b − a|
At iteration n = 1 ⇒
2
|b − a|
At iteration n = 2 ⇒
22
|b − a|
At iteration n = 3 ⇒
23
Therefore:
|b − a|
At the final iteration n = k ⇒ <ε
2k
Thus:
ln(b − a) − ln(ε)
k≥
ln(2)
Example:
What is the number of iterations needed to achieve a precision of 10−2 to solve the equation
x3 − 2x + 7 = 0 in the interval [1, 2] ?
ln(2 − 1) − ln(0.01)
k≥ ⇒ k ≥ 6.64 ⇒ k = 7 iterations
ln(2)
The Newton method can be derived on the basis of this geometrical interpretation. As in
Fig. 1.2, the first derivative at x is equivalent to the slope:
f (xi ) − 0
f ′ (xi ) =
xi − xi+1
which can be rearranged to yield
f (xi )
xi+1 = xi −
f ′ (xi )
which is called the Newton formula.
In this case, there exists x0 ∈ [a, b] such that f (x0 ).f ′′ (x0 ) > 0.
Then, the Newton sequence is defined as:
(
x0 ,
xn+1 = xn − ff′(x n)
(xn )
Example:
Find the root of x4 + 2x3 − x − 1 = 0 in the interval [0, 1] with a precision of 0.05.
f (0) = −1, f (1) = 1. Since f (0) · f (1) < 0, a root exists in [0, 1].
Conditions of Convergence:
1) f (0) · f (1) < 0
2) ∀x ∈ [0, 1], f ′ (x) = 4x3 + 6x2 − 1 ̸= 0
3) ∀x ∈ [0, 1], f ′′ (x) = 12x2 + 12x ̸= 0 if x ̸= 0, (We can’t choose x0 = 0)
choice of x0 :
So:
f (1) 1
x1 = 1 − ′
= 1 − ≈ 1 − 0.1111 ≈ 0.8889, (|x1 − x0 | = 0.1111 > ϵ )
f (1) 9
f (x1 )
x2 = x1 − ≈ 0.8675, , (|x2 − x1 | = 0.0214 < ϵ , Stop)
f ′ (x1 )
The root is therefore : α =0.8675 ± 0.05