Solution of Nonlinear Equations f (x) = 0
Professor Ph.D. Cesar A Aceros Moreno
Universidad Industrial de Santander
Colombia
2025
Professor Cesar Aceros Numerical methods 2025 1 / 71
Outline
1 Solution of Nonlinear Equations
2 Bracketing Methods for Locating a Root
3 Newton-Raphson and Secant Methods
Professor Cesar Aceros Numerical methods 2025 2 / 71
Nonlinear Equations
Definition
A nonlinear equation is one that contains variables of degree
greater or lower than 1.
Professor Cesar Aceros Numerical methods 2025 3 / 71
Nonlinear Equations
Definition
A nonlinear equation is one that contains variables of degree
greater or lower than 1.
Examples:
f (x, y) = x2 + y, the variable x is of degree 2 > 1.
√ 1
f (x, y) = y + 2x, the variable y is of degree < 1.
2
Professor Cesar Aceros Numerical methods 2025 3 / 71
Nonlinear Equations
Definition
A nonlinear equation is one that contains variables of degree
greater or lower than 1.
Examples:
f (x, y) = x2 + y, the variable x is of degree 2 > 1.
√ 1
f (x, y) = y + 2x, the variable y is of degree < 1.
2
Nonlinear equations are important due to they commonly appear
in physical phenomenas.
Professor Cesar Aceros Numerical methods 2025 3 / 71
Nonlinear Equations
Example: The problem of a spherical ball of radius r and density ρ that
is submerged to a depth d in water.
𝑟𝑎𝑑𝑖𝑢𝑠 𝑟
𝑑𝑒𝑛𝑠𝑖𝑡𝑦 𝜌
𝑑𝑒𝑝𝑡ℎ 𝑑
Professor Cesar Aceros Numerical methods 2025 4 / 71
Nonlinear Equations
Example: The problem of a spherical ball of radius r and density ρ that
is submerged to a depth d in water.
The Archimedes’ law is applied to know the
𝑟𝑎𝑑𝑖𝑢𝑠 𝑟 submerged depth d:
𝑑𝑒𝑛𝑠𝑖𝑡𝑦 𝜌
The mass of water displaced Mw is equal to the
mass of the ball Mb .
𝑑𝑒𝑝𝑡ℎ 𝑑
Mw = Mb (1)
Professor Cesar Aceros Numerical methods 2025 4 / 71
Nonlinear Equations
Example: The problem of a spherical ball of radius r and density ρ that
is submerged to a depth d in water.
The Archimedes’ law is applied to know the
𝑟𝑎𝑑𝑖𝑢𝑠 𝑟 submerged depth d:
𝑑𝑒𝑛𝑠𝑖𝑡𝑦 𝜌
The mass of water displaced Mw is equal to the
mass of the ball Mb .
𝑑𝑒𝑝𝑡ℎ 𝑑
Mw = Mb (1)
The equality in (1) leads to the nonlinear equation:
π(d3 − 3d2 r + 4r3 ρ)
f (d) = = 0, where, r and d are known.
3
The depth d is found by solving f (d) = 0.
Professor Cesar Aceros Numerical methods 2025 4 / 71
Solution of Nonlinear Equations
SOLVING NONLINEAR EQUATION
Then, the goal is to develop a variety of methods for finding numerical
approximations of the roots of a nonlinear equation.
A root is a value of the variable x that makes f (x) = 0.
Professor Cesar Aceros Numerical methods 2025 5 / 71
Iteration approach for finding roots
Iteration methods consist in repeating a process until to achieve
an answer.
pk+1 = g(pk )
Professor Cesar Aceros Numerical methods 2025 6 / 71
Iteration approach for finding roots
Iteration methods consist in repeating a process until to achieve
an answer.
pk+1 = g(pk )
They need a starting value p0 and a rule or function g(x) for
computing successive terms pk :
General Sequence
Function Staring value Iterative rule
p0 g(x) P0 Pk+1 = g(Pk )
p1 = g(p0 )
p2 = g(p1 )
..
.
pk = g(pk−1 )
pk+1 = g(pk )
..
.
Professor Cesar Aceros Numerical methods 2025 6 / 71
Iteration approach for finding roots
Iteration methods consist in repeating a process until to achieve
an answer.
pk+1 = g(pk )
They need a starting value p0 and a rule or function g(x) for
computing successive terms pk :
General Sequence
Function Staring value Iterative rule
p0 g(x) P0 Pk+1 = g(Pk )
p1 = g(p0 )
p2 = g(p1 ) Possible results:
.. ✓Unending sequence of numbers
.
pk = g(pk−1 ) ✓Diverge or periodic sequences
pk+1 = g(pk ) ✓Convergent sequences
..
.
Professor Cesar Aceros Numerical methods 2025 6 / 71
Iteration for Solving x = g(x)
Finding Fixed Points
Definition 1.
A fixed point of a function g(x) is a real number P such that P = g(P).
Professor Cesar Aceros Numerical methods 2025 7 / 71
Iteration for Solving x = g(x)
Finding Fixed Points
Definition 1.
A fixed point of a function g(x) is a real number P such that P = g(P).
Definition 2.
The iteration pn+1 = g(pn ) for n = 0, 1, ... is called fixed-point iteration.
Professor Cesar Aceros Numerical methods 2025 7 / 71
Iteration for Solving x = g(x)
Finding Fixed Points
Definition 1.
A fixed point of a function g(x) is a real number P such that P = g(P).
Definition 2.
The iteration pn+1 = g(pn ) for n = 0, 1, ... is called fixed-point iteration.
Theorem 1.
Assume that g is a continous function and that {pn }∞
n=0 is a sequence
generated by fixed-point iteration. If limn→∞ pn = P, then P is a fixed
point of g(x).
Professor Cesar Aceros Numerical methods 2025 7 / 71
Iteration for Solving x = g(x)
Example:
Given the starting point, p0 = 0.5, and the rule iteration pk+1 = e−pk ,
find the sequence for k = 0, 1, ....
Professor Cesar Aceros Numerical methods 2025 8 / 71
Iteration for Solving x = g(x)
Example:
Given the starting point, p0 = 0.5, and the rule iteration pk+1 = e−pk ,
find the sequence for k = 0, 1, ....
p1 = e−p0 = p1 = e−0.500000 = 0.606531
Professor Cesar Aceros Numerical methods 2025 8 / 71
Iteration for Solving x = g(x)
Example:
Given the starting point, p0 = 0.5, and the rule iteration pk+1 = e−pk ,
find the sequence for k = 0, 1, ....
p1 = e−p0 = p1 = e−0.500000 = 0.606531
p2 = e−p1 = p2 = e−0.606531 = 0.545239
p3 = e−p2 = p3 = e−0.545239 = 0.579703
.. ..
. .
p9 = e−p8 = p9 = e−0.566409 = 0.567560
p10 = e−p9 = p10 = e−0.567560 = 0.566907
Professor Cesar Aceros Numerical methods 2025 8 / 71
Iteration for Solving x = g(x)
Example:
Given the starting point, p0 = 0.5, and the rule iteration pk+1 = e−pk ,
find the sequence for k = 0, 1, ....
p1 = e−p0 = p1 = e−0.500000 = 0.606531
p2 = e−p1 = p2 = e−0.606531 = 0.545239
p3 = e−p2 = p3 = e−0.545239 = 0.579703
.. ..
. .
p9 = e−p8 = p9 = e−0.566409 = 0.567560
p10 = e−p9 = p10 = e−0.567560 = 0.566907
lim pn = 0.567143 . . . .
n→∞
Approximation for the fixed point of the function y = e−x .
Professor Cesar Aceros Numerical methods 2025 8 / 71
Iteration for Solving x = g(x)
Finding Fixed Points
Theorem 2.
Assume that g ∈ C[a, b].
1. If the range of the mapping y = g(x) satisfies y ∈ [a, b] for all x ∈ [a, b],
then g has a fixed point in [a, b].
2. Furthermore, suppose that g′ (x) is defined over (a, b) and that a
positive constant K < 1 exists with |g′ (x)| ≤ K < 1 for all x ∈ (a, b); then
g has a unique fixed point P in [a, b].
Professor Cesar Aceros Numerical methods 2025 9 / 71
Iteration for Solving x = g(x)
Example:
1
Let y = , x on [0.5, 5.2]. Determine if a fixed point exists according to
x
literal 1 in Theorem 2.
Professor Cesar Aceros Numerical methods 2025 10 / 71
Iteration for Solving x = g(x)
Example:
1
Let y = , x on [0.5, 5.2]. Determine if a fixed point exists according to
x
literal 1 in Theorem 2.
The range of the mapping y = g(x) does not satisfy y ∈ [0.5, 5.2] for all
x ∈ [0.5, 5.2].
Professor Cesar Aceros Numerical methods 2025 11 / 71
Iteration for Solving x = g(x)
Example:
1
Let y = , x on [0.5, 2]. Determine if a fixed point exists according to
x
literal 1 in Theorem 2.
The range of the mapping y = g(x) satisfies y ∈ [0.5, 2] for all
x ∈ [0.5, 2].
Professor Cesar Aceros Numerical methods 2025 12 / 71
Iteration for Solving x = g(x)
Example:
1
Let y = , x on [0.5, 2]. Determine if the fixed point is unique
x
according to literal 2 in Theorem 2.
Professor Cesar Aceros Numerical methods 2025 13 / 71
Iteration for Solving x = g(x)
Theorem 3. Fixed Point Theorem.
Assume that (i) g, g′ ∈ C[a, b], (ii) K is a positive constant, (iii) p0 ∈ (a, b),
and (iv) g(x) ∈ [a, b] for all x ∈ [a, b] .
* If |g′ (x)| ≤ K < 1 for all x ∈ [a, b], then the iteration pn = g(pn−1 ) will
converge to the unique fixed point P ∈ [a, b]. In this case, P is said to be
an attractive fixed point.
** If |g′ (x)| > 1 for all x ∈ [a, b], then the iteration pn = g(pn−1 ) will not
converge to P. In this case, P is said to be a repelling fixed point and
the iteration exhibits local divergence.
Remark 1. It is assumed that p0 ̸= P in statement *.
Remark 2. Because g is continuous on an interval containing P, it is permissible to use the
simpler criterion |g′ (P)| ≤ K < 1 and |g′ (P)| > 1 in * and **, respectively.
Professor Cesar Aceros Numerical methods 2025 14 / 71
Iteration for Solving x = g(x)
Graphical Interpretation of Fixed-Point Iteration
A fixed point is the intersection between y = x and y = g(x).
Professor Cesar Aceros Numerical methods 2025 15 / 71
Iteration for Solving x = g(x)
Graphical Interpretation of Fixed-Point Iteration
A fixed point is the intersection between y = x and y = g(x).
Possible cases of convergence.
Professor Cesar Aceros Numerical methods 2025 15 / 71
Iteration for Solving x = g(x)
Graphical Interpretation of Fixed-Point Iteration
A fixed point is the intersection between y = x and y = g(x).
Possible cases of convergence.
Monotone convergence when 0 < g′ (P) < 1.
Professor Cesar Aceros Numerical methods 2025 15 / 71
Iteration for Solving x = g(x)
Oscillating convergence when −1 < g′ (P) < 0.
Professor Cesar Aceros Numerical methods 2025 16 / 71
Iteration for Solving x = g(x)
Monotone divergence when 1 < g′ (P).
Professor Cesar Aceros Numerical methods 2025 17 / 71
Iteration for Solving x = g(x)
Divergent oscillation when g′ (P) < −1.
Professor Cesar Aceros Numerical methods 2025 18 / 71
Iteration for Solving x = g(x)
Summary
(a) Monotone convergence when (b) Oscillating convergence when
0 < g′ (P) < 1. −1 < g′ (P) < 0.
y y y=x
y=x
(p0 , g(p0))
(p0 , g(p0))
(p1 , p1) (p1 , p1)
P
P y = g(x)
y = g(x)
x x
P P2 P1 P0 P0 P2 P P1
(c) Monotone divergence when (d) Divergent oscillation when
1 < g′ (P). g′ (P) < −1.
y y = g(x) y
y = g(x)
y=x
y=x
(p0 , g(p0))
P
x x
P P0 P1 P2 P2 P0 P P1 P3
Professor Cesar Aceros Numerical methods 2025 19 / 71
Iteration for Solving x = g(x)
Example:
Consider the iteration pn+1 = g(pn ) when the function g(x) = 2(x − 1)1/2 for x ≥ 1 is
used.
Professor Cesar Aceros Numerical methods 2025 20 / 71
Iteration for Solving x = g(x)
Example:
Consider the iteration pn+1 = g(pn ) when the function g(x) = 2(x − 1)1/2 for x ≥ 1 is
used.
Only one analytical fixed point P = 2 exists.
Professor Cesar Aceros Numerical methods 2025 20 / 71
Iteration for Solving x = g(x)
Example:
Consider the iteration pn+1 = g(pn ) when the function g(x) = 2(x − 1)1/2 for x ≥ 1 is
used.
Only one analytical fixed point P = 2 exists. The derivative is g′ (x) = 1/(x − 1)1/2 and
g′ (2) = 1, so Theorem 3 does not apply. There are two cases to consider when the
starting value lies to the left or right of P = 2.
Start with p0= 1.5 p0 = 2.5
p1= 1.41421356 p1 = 2.44948974
p2= 1.28718851 p2 = 2.40789513
Sequence
p3= 1.07179943 p3 = 2.37309514
p4= 0.53590832 p4 = 2.34358284
.. ..
. .
p5 = 2(−0.46409168)1/2 lim pn = 2
n→∞
Conclusion Since p4 lies outside This sequence is converging
the domain of g(x), the term too slowly to the value P = 2;
p5 cannot be computed indeed, P1000 = 2.00398714
Professor Cesar Aceros Numerical methods 2025 20 / 71
Iteration for Solving x = g(x)
Absolute Error Considerations
Consider the iteration pn+1 = g(pn ) when the function g(x) = 2(x − 1)1/2
for x ≥ 1 is used.
g′ (x) = 1/(x − 1)1/2 and g′ (2) = 1
p1000 = 2.00398714, p1001 = 2.00398317 and p1002 = 2.00397921
WHAT ABOUT A CRITERION FOR STOPPING THE ITERATION?
1. Approximation absolute error
|p1001 − p1002 | = 0.00000396
2. Absolute error
|P − p1000 | = 0.00398714
Professor Cesar Aceros Numerical methods 2025 21 / 71