Nonlinear Equation Solutions Overview
Nonlinear Equation Solutions Overview
Solution of Nonlinear
Equations
Examples:
2 and 3 are zeros of the function f(x) = (x-2)(x-3).
f ( x) x 1( x 2)
f ( x) ( x 1)x 2 x 2 x 2
has two simple zeros (one at x 2 and one at x 1)
By: Habtamu Garoma April 23, 2025
Multiple Zeros
7
f ( x ) x 1
2
f ( x) x 1 x 2 2 x 1
2
3
f ( x) x
Analytical Solutions
Possible for special equations only
Graphical Solutions
Useful
for providing initial guesses for other
methods
Numerical Solutions
Open methods
Bracketing methods
By: Habtamu Garoma April 23, 2025
Analytical Methods
10
x
Solve e
2 Root
x
x e x
The root [0,1] 1
root 0.6
1 2
Secant Method
Newton’s Method
xn x n N
BISECTION
METHOD
The Bisection Algorithm
Convergence Analysis of Bisection
Method
Examples
Intermediate value
theorem:
a b
if a function is continuous
and f(a) and f(b) have f(b)
different signs then the
function has at least one
zero in the interval [a,b].
By: Habtamu Garoma April 23, 2025
Examples
21
Assumptions:
Given an interval [a,b]
f(x) is continuous on [a,b]
f(a) and f(b) have opposite signs.
Assumptions:
f(x) is continuous on [a,b]
f(a) f(b) < 0 f(a)
Algorithm:
Loop c b
1. Compute the mid point c=(a+b)/2
2. Evaluate f(c) a
3. If f(a) f(c) < 0 then new interval [a, c]
If f(a) f(c) > 0 then new interval [c, b]
f(b)
End loop
b0
a0 a1 a2
+ + -
+ - -
+ + -
Answer:
f ( x) is continuous on [0,2]
and f(0) * f(2) (1)(3) 3 0
Assumptions are not satisfied
Bisection method can not be used
Answer:
f ( x) is continuous on [0,1]
and f(0) * f(1) (1)(-1) 1 0
Assumptions are satisfied
Bisection method can be used
Questions:
What is the best estimate of the zero of
f(x)?
What is the error level in the obtained
estimate?
By: Habtamu Garoma April 23, 2025
Best Estimate and Error
31
Level
The best estimate of the zero of the
function f(x) after the first iteration of
the Bisection method is the mid point of
the initial interval:
ba
Estimate of the zero : r
2
b a
Error
2
After n iterations :
0
b a x
error r - cn Ean n n
2 2
log(b a ) log( )
n
log(2)
By: Habtamu Garoma April 23, 2025
Convergence Analysis –
35
Alternative Form
log(b a ) log( )
n
log(2)
n 11
By: Habtamu Garoma April 23, 2025
Example
37
After 5 iterations:
Interval containing the root: [0.725, 0.75]
Best estimate of the root is 0.7375
| Error | < 0.0125
* f(x) is continuous
* f( 0 ) 1, f (1) 1 f (a ) f (b) 0
Bisection method can be used to find the root
c= (a+b)
(b-a)
Iteration a b f(c)
2
2
1 0 1 0.5 -0.375 0.5
2 0 0.5 0.25 0.266 0.25
3 0.25 0.5 .375 -7.23E-3 0.125
4 0.25 0.375 0.3125 9.30E-2 0.0625
5 0.3125 0.375 0.34375 9.37E-3 0.03125
Solution
𝑋2 = = 1.375
1.25+1.5
2
Take and
𝑋3 = = 1.34375 and
1.3125+1.375
2
Take
𝑋4 = = 1.328125
1.3125+1.34375
2
49
a b f(a) f(b) c = (a + b)/2 f(c) Update new b − a
Advantages
Simple and easy to implement
Disadvantage
Slow to converge
2. Regula Falsi
Method
f xU
f ( x ) 0 (1)
In the Bisection method
f ( x L ) * f ( xU ) 0 (2)
Exact root
xL
x L xU
O xr xU x
xr (3)
f xL 2
1
54
Figure 1 False-Position Method
By: Habtamu Garoma April 23, 2025
False-Position
Method
f ( x L ) 0; xr x L 0
f ( xU ) 0; xr xU 0
By: Habtamu Garoma April 23, 2025
From Eq. (4), one obtains
xr xL f xU xr xU f xL
xU f x L x L f xU xr f x L f xU
The above equation can be solved to obtain the nex
predicted root xr, as
xU f x L x L f xU
xr (5)
f x L f xU
By: Habtamu Garoma April 23, 2025
The above equation,
3
1 1 1
f 4 1 0.296296296 0
3 3 3
1
the root lies between 0 and
3
By: Habtamu Garoma April 23, 2025
62
Hence
0.257142857
= 0.254202116
1.011568513
f 0.254202116 0.00038225166 0
False-position Method
Iteration xl xu xr εa (%) εt (%)
1 0 1.3 0.09430 90.6
2 0.09430 1.3 0.18176 48.1 81.8
3 0.18176 1.3 0.26287 30.9 73.7
4 0.26287 1.3 0.33811 22.3 66.2
5 0.33811 1.3 0.40788
By: Habtamu
17.1
Garoma
59.2
April 23, 2025
65
By: Habtamu Garoma 66
3. secant Method
Approximate the
derivative f ( xi ) f ( xi 1 ) (2)
f ( xi )
f ( x i-1 ) xi xi 1
Substituting Equation
X
x i+ 2 x i+ 1 xi
(2) into Equation (1)
gives the Secant
method f ( xi )( xi xi 1 )
Figure 1: Geometrical illustration of xi 1 xi
the Newton-Raphson f ( xi ) f ( xi 1 )
method. By: Habtamu Garoma April 23, 2025
Secant Method –
Derivation
The secant method can also be derived from geometry:
f(x)
The Geometric Similar Triangles
AB DC
f(xi) B AE DE
can be written as
f ( xi ) f ( xi 1 )
C
xi xi 1 xi 1 xi 1
f(xi-1)
E D A
On rearranging, the secant
X
xi+1 xi-1 xi method is given as
f ( xi )( xi xi 1 )
Figure 2: Geometrical xi 1 xi
representation of the Secant f ( xi ) f ( xi 1 )
By: Habtamu Garoma April 23, 2025
method.
Algorithm for Secant
Method
Calculate the next estimate of the root from two initial guesses
f ( xi )( xi xi 1 )
xi 1 xi
f ( xi ) f ( xi 1 )
Find the absolute relative approximate error
xi 1- xi
a = 100
xi 1
x0 , x1 , i 1
( xi xi 1 )
xi 1 xi f ( xi ) ;
f ( xi ) f ( xi 1 )
i i 1
NO Yes
xi 1 xi Stop
40
5 3
f ( x) x x 3 30
20
Initial points 10
-20
-30
-40
( xi xi 1 )
xi 1 xi f ( xi )
f ( xi ) f ( xi 1 )
By: Habtamu Garoma April 23, 2025
Solution
76
_______________________________
k xk f(xk)
_______________________________
0 1.0000 -1.0000
1 1.5000 8.8906
2 1.0506 -0.7062
3 1.0836 -0.4645
4 1.1472 0.1321
5 1.1331 -0.0165
6 1.1347 -0.0005
0
y
-5 -4 -3 -2 -1 0 1 2 3 4 5
-1
y=x
-2
-3
-4
x
4
y = (x3 + 3)/7
3
0
y
-5 -4 -3 -2 -1 0 1 2 3 4 5
-1
y=x -2
-3
-4
x
By: Habtamu
April 23, 2025Garoma
Fixed Point Iteration
The rearrangement x = (x3 + 3)/7 leads to the iteration
3
x 3
xn 1 n , n 0, 1, 2, 3, ...
7
To find the middle root , let initial approximation x0 = 2.
3
x0 3 23 3
x1 1.57143
7 7
3
x1 3 1.571433 3
x2 0.98292
7 7
3
x2 3 0.982923 3
x3 0.56423
7 7
3
x3 3 0.564233 3 etc
x4 0.45423
7 7 .
n xn
0 2 1.5
1 1.57143 y=x
2 0.98292 y = (x3 + 3)/7
y 1
3 0.56423
4 0.45423
5 0.44196 0.5
6 0.4409
7 0.44082 0
8 0.44081 0 0.5
x3
1
x
1.5
x1
2
x0
x2
2 11.6739 4
3 227.702 2
4 1686559 x0 x1
0
5 6.9E+17 0 2 4 6 8 10
x
Assumptions:
f(x) is continuous and the first derivative is
known
An initial guess x0 such that f’(x0)≠0 is given
f( xn )
xn 1 xn , n 0, 1, 2, 3, ...
f ( xn )
15
f ( x0 )
f ' ( x0 )
10 x0 x1
f(x0)
5
f ( x0 )
x1 x0
0 x1 x0
f ( x0 )
2 3
-5
1.5
Guess: 3
1 2
f 3 3 3 1.5
z
2
1.5 1.5
1.5 3 z
3 2.5 z 3
3 (new guess)
91 By: Habtamu Garoma April 23, 2025
1 2
1.5 f x x 3
2
f x x
Guess:2.5
1
f 2.5 2.5 3 .125
2
z 2
mtangent f 2.5 2.5
.125
.125 z
2.5 2.45 2.5
2.5 (new guess)
92 By: Habtamu Garoma April 23, 2025
1 2
1.5 f x x 3
2
f x x
Guess: 2.45
f 2.45 .00125
z
.00125
z
2.45
.00125
93 2.45 2.44948979592 (newApril
By: Habtamu Garoma guess)
23, 2025
2.45
Guess: 2.44948979592
f 2.44948979592 .00000013016
1.3252004
3
1.3252004 1.0020584 1
95 By: Habtamu Garoma April 23, 2025
Example
96
0 4 33 33 3 1
1 3 9 16 2.4375 0.5625
f ( xk )
xk f ( xk ) f ' ( xk )
f ' ( xk )
1.0000 - 0.6321 - 1.3679 0.4621
0.5379 0.0461 - 1.5840 - 0.0291
0.5670 0.0002 - 1.5672 - 0.0002
0.5671 0.0000 - 1.5671 - 0.0000
Theorem :
Let f(x), f ' (x) and f ' ' (x) be continuous at x r
where f(r) 0. If f ' (r) 0 then there exists 0
xk 1-r
such that x0 -r 2
C
xk -r
max f ' ' ( x)
1 x0 -r
C
2 min f ' ( x)
x0 -r