Chapter 2 Locating Roots of Equations T2 1415 PDF
Chapter 2 Locating Roots of Equations T2 1415 PDF
Chapter 2 Locating Roots of Equations T2 1415 PDF
Page | 1
KCY/NOORSHAHIDA/THL
CHAPTER 2 LOCATING ROOTS OF EQUATIONS
In this Chapter, you will learn:
three methods to find the roots of equations,
the difference among the three methods.
1. BISECTION METHOD
If a function ( ) x f is continuous between a and b, and ( ) a f and ( ) b f are of opposite
signs, then there exists at least one root between a and b.
Figure 1: The graphical representation of the Bisection method
TO START the Bisection method, an interval [ ] b a, must be found with ( ) ( ) . 0 < b f a f
Set a a =
1
, b b =
1
and let
1
p be the midpoint of the interval [ ]
1 1
, b a .
2
1 1
1
b a
p
+
=
a = a
1
b = b
1
p
1
p
p
2
p
3
a
1
a
2
b
1
b
2
a
3
b
3
p
2
p
1
TRIMESTER 2 2014/2015 TMA1301 COMPUTATIONAL METHODS CHAPTER 2
Page | 2
KCY/NOORSHAHIDA/THL
IN GENERAL
An interval [ ]
1 1
,
+ + n n
b a containing an approximation to a root of ( ) 0 = x f is constructed
from an interval [ ]
n n
b a , containing the root by the first letting
2
n n
n
a b
p
+
=
Then set
n n
a a =
+1
and
n n
p b =
+1
, if ( ) ( ) 0 <
n n
p f a f , and otherwise
n n
p a =
+1
and
n n
b b =
+1
.
There are three iteration criteria:
There are three stopping criteria:
Example 1: Find a root of ( ) 0 10 4
2 3
= + = x x x f starting with 1 = a , 2 = b and
tolerance 2*10
-3
by Bisection method.
Iteration, n
n
a
n
b
n
p ( )
n
a f ( )
n
p f ( ) ( )
n n
p f a f
1 1.000000 2.000000 1.500000 -5 2.375000 -
2 1.000000 1.500000 1.250000 -5 -1.796875 +
3 1.250000 1.500000 1.375000 -1.796875 0.162109 -
4 1.250000 1.375000 1.312500 -1.796875 - 0.848389 +
5 1.312500 1.375000 1.343750 - 0.848389 - 0.350983 +
6
7
8
9
1. If ( )
n
a f and ( )
n
p f have OPPOSITE signs, then p is in the interval [ ]
n n
p a , .
2. If ( )
n
a f and ( )
n
p f have SAME signs, then p is in the interval [ ]
n n
b p , .
3. If ( ) 0 =
n
p f , then
n
p is a ROOT of the equation ( ) 0 = x f .
1. If one of the midpoints happens to COINCIDE with the root.
2. The length of search interval is LESS THAN OR EQUAL tolerance.
3. If the number of iterations EXCEEDS a preset bound
0
N .
TRIMESTER 2 2014/2015 TMA1301 COMPUTATIONAL METHODS CHAPTER 2
Page | 3
KCY/NOORSHAHIDA/THL
2. SECANT METHOD
Although the Bisection Method always converges, the speed of convergence is usually
too slow for general use. The Secant method does not have the root bracketing property
of the Bisection Method. But it does converge. It generally does so much faster than the
Bisection Method.
Figure 2: The graphical representation of the Secant method
IN GENERAL
The approximation
1 + n
p
for 1 > n
to a root of ( ) 0 = x f
is computed from the
approximations
n
p and
1 + n
p
using the equation.
( )( )
( ) ( )
1
1
1
=
n n
n n n
n n
p f p f
p p p f
p p
There are two stopping criteria:
p
0
p
1
p
2
p
p
3
p
4
p
5
1. We assume that
n
p is sufficiently accurate when
1
n n
p p is within a given tolerance.
2. The maximum number of iterations is given.
TRIMESTER 2 2014/2015 TMA1301 COMPUTATIONAL METHODS CHAPTER 2
Page | 4
KCY/NOORSHAHIDA/THL
Example 2: Find a root of ( ) 0 10 4
2 3
= + = x x x f
starting with
0
p 1 = ,
1
p 2 = and
tolerance 1*10
-3
by Secant method.
Iteration, n
1 + n
p ( )
1 + n
p f
1 1.263157 - 1.602288
2 1.338827 -0.430378
3
4
5
TRIMESTER 2 2014/2015 TMA1301 COMPUTATIONAL METHODS CHAPTER 2
Page | 5
KCY/NOORSHAHIDA/THL
3. NEWTONS METHOD
The Bisection and Secant methods both have geometric representations that use the zero
of an approximating line to the graph of a function f to approximate the solution
to ( ) 0 = x f .
The accuracy of the Secant method increases than the Bisection method because the
secant line to the curve is better approximation to the graph of f.
The line that best approximates the graph of the function at a point is the tangent line.
Using this line instead of the secant line produces Newton's method (also called Newton-
Raphson method).
Suppose that
0
p is an initial approximation to the root p of the equation ( ) 0 = x f and
that f' exists in an interval containing all the approximations to p. The slope of the tangent
line to the graph of f at the point ( ) ( )
0 0
, p f p is ( ) x f ' , so the equation of this tangent line
is
( ) ( )( )
0 0 0
' p x p f p f y =
which implies that
( )
( )
0
0
0 1
' p f
p f
p p = where ( ) 0 '
0
p f
Figure 3: The graphical representation of the Newton-Raphson method
slope of f '(p
1
)
y = f(x)
slope of f '(p
0
)
p
0
p
1
p
p
2
TRIMESTER 2 2014/2015 TMA1301 COMPUTATIONAL METHODS CHAPTER 2
Page | 6
KCY/NOORSHAHIDA/THL
IN GENERAL
The approximation
n
p to a root of ( ) 0 = x f is computed from the approximation
n
p using
the equation
( )
( )
1
1
1
'
=
n
n
n n
p f
p f
p p
Example 3: Find a root of ( ) 0 10 4
2 3
= + = x x x f starting with 1
0
= p and tolerance
3
10 1
by Newtons method.
Iteration, n
n
p ( )
n
p f
1 1.454545 1.540187
2 1.368900 0.060712
3
4
5