NM Lect2
NM Lect2
ROOTS OF EQUATIONS
review
The Taylor series
Zero-order approximation: f ( xi 1 ) f ( xi )
2!
and so on…
f ' ' ( xi )
f ( xi 1 ) f ( xi ) f ' ( xi )( xi 1 xi ) ( xi 1 xi ) 2
2!
( 3) (n)
f ( xi ) f ( xi )
( xi 1 xi ) ..........
3
( xi 1 xi ) Rn
n
3! n!
where Rn is a remainder term
(5) ©Dr. Khaldoon A. Bani-Hani
review
f n1 ( ) n 1
R ( x
Remainder term: n (n 1)! i 1 1 x )
Simple fixed
Graphical
Newton Raphson
Bisection
Secant method
False Position
Multiple roots
Roots of polynomials, Using computers, Muller’s Method
8 ©Dr. Khaldoon A. Bani-Hani
Roots of Equations
Root of an equation: is the value of the equation variable
which makes the equations = 0.0 (zeros)
f ( X ) ax 2 bx c
b b 2 4ac
for f ( x) 0.0 x
2a
• Classical methods:
Exact solution (not always available)
Trial and Error (non systematic procedures)
Graphical solution (inaccurate)
• Numerical systematic methods suitable for computers
(9) ©Dr. Khaldoon A. Bani-Hani
-Graphical Solution
• Plot the function f(x)
f(x)
roots
f(x)=0
f(x)=0 f(x)=0 x
f(xl)=+ve f(xl)=+ve
2 roots roots
f(xu)=+ve
x x
xl xu xl f(xu)=-ve
f(x) xu
f(x)
6 roots f(xl)=+ve
5 roots (odd)
x x
xl xu xl xu f(xu)=-ve
(13) ©Dr. Khaldoon A. Bani-Hani
Bracketing Methods (Or, two point methods for finding roots)
1. Bisection Method (Interval Halving)
Generally if f(x) is real and continuous in the interval xl to xu and
the interval is divided in half with the root lies in the midpoint
of the subinterval. This process is repeated to obtained refined
estimates.
(14) ©Dr. Khaldoon A. Bani-Hani
1: Pick lower xl and upper xu guesses for the f(x)
root such that the function changes sign over the xr = ( xl + xu )/2
interval, i.e f(xl).f(xu)<0
f(xl)
2: An estimate of the root is:
xr = ( xl + xu )/2 f(xr1)
c
f(c) mg t
f (c ) (1 e ) v
m
c
6.067
667.38
f (c ) (1 e0.146843c ) 40
c
1.569
c Assume xl = 12 and xu=16
12 14 16
-2.269
c
mg t
f (c) (1 e ) v
m
c
667.38
f (c) (1 e 0.146843c ) 40
c
f(12)f(16)<0
6.067
The first estimate for the root:
2.2688(12 16) 14.91
xr 16 14.9113
6.0669 (2.2688)
f(12).f(14.9113) =-1.5426<0; the root lies x
12 16
in the first subinterval [12,14.9113].
14.79 -2.269
Update xl = 12 and xu=14.9113,
0.2543(12 14.9113)
xr 14.9113 14.7942
6.0669 (0.2543)
The 2nd estimate is xr= 14.7942
This has an approximate error of 0.79%
Converging
increments
f 2 ( x) e x
x
xr
(37) ©Dr. Khaldoon A. Bani-Hani
(38) ©Dr. Khaldoon A. Bani-Hani
(39) ©Dr. Khaldoon A. Bani-Hani
(40) ©Dr. Khaldoon A. Bani-Hani
Open Methods
2. The Newton Raphson Method
Newton's method is an iterative method
f(x)
for root finding. That is, starting from
some guess at the root, x0; one iteration of
the algorithm produces a number x1; f(xi)
which is supposed to be closer to a root;
guesses x2; x3; : : : ; xn follow identically. Slope f /(xi)
f(xi+1) xi
Newton's method uses “linearization” to
Root
find an approximate root. Recalling xi+1
Taylor's Theorem, we know that
f ( xi 1 ) f ( xi ) f ' ( xi )( xi 1 xi )
f ( xi 1 ) f ( xi )
f ( xi ) 0 f ( xi )
f ( xi )
/
xi 1 xi /
xi xi 1 f ( xi ) xi 1 xi
(41) ©Dr. Khaldoon A. Bani-Hani
A tangent to f(x) at the initial point xi is extended till it meets
the x-axis at the improved estimate of the root xi+1.
0 f ( xi ) f ( xi )( xi 1 xi )
f ( )
0 f ( xi ) f ( xi )( xr xi ) ( xr xi ) 2
2!
f ( )
0 f ( xi )( xr xi 1 ) ( xr xi ) 2
2!
f ( ) 2
E t , i 1 xr xi 1 0 f ( xi ) Et ,i 1 Et , i
2!
f ( xr ) 2
Et , i 1 Et , i
2 f ( xr )
xi 1 xi
xi xi 1
(43) ©Dr. Khaldoon A. Bani-Hani
(44) ©Dr. Khaldoon A. Bani-Hani
Poor convergence
xi 1 xi xi
xi+1 xi-1
This yields the following equation:
f ( xi )( xi 1 xi )
xi 1 xi Root
f ( xi 1 ) f ( xi )
(47) ©Dr. Khaldoon A. Bani-Hani
Example 6.6
Use Secant method to estimate the root of f(x)=e-x-x
employing an initial guess of x1 0, and x0 1
First iteration,
0.63212(0 1)
x1 1 0.61270 t 8.0%
1 ( .63212)
Second iteration:
0.0708(1 0.61270)
x2 0.61270 0.56384 t 0.58%
.63212 ( 0.07081)
Third iteration:
0.00518(0.61270 0.56384)
x3 0.56384 0.56717 t 0.0048%
0.07081 (0.00518)