Secant Method: Example
Secant Method: Example
Secant Method
The idea underlying the secant method is the same as the one underlying Newton's method: to nd an
approximate zero of a function f (x) we nd instead a zero for a linear function F (x) that corresponds to a
\best straight line t" to f (x). In Newton's method, the function representing the best straight line t is
determined by the rst order Taylor expansion:
F (x) = f (xo ) + f 0 (xo ) (x , x0)
In the secant method, we instead determine a \best straight line t" by determining the linear function
whose graph corresponds to a line that connects two points on the graph of f (x).
Recall that the line that passes through two points (x0 ; y0) and (x1; y1 ) is prescribed by
y = y0 + xy1 , , y0 (x , x )
0
1 x0
Let (x0; f (x0 )) and (x1; f (x1)) be two nearby points on the graph of f (x). The line passing through these
two points is thus
y = F (x) f (x0 ) + f (xx1 ) , f (x0 ) (x , x )
0
1 , x0
Now the function F (x) has a zero at x2 if
0 = f (x0 ) + f (xx1 ) , f (x0) (x , x )
2 0
1 , x0
or
x 1 ,
x2 = x0 , f (x0 ) f (x ) , f (x )x 0
1 0
If we regard, x1, x0, and x2 as successive approximations for an actual zero of f (x) we can interprete this
calculation as an algorithm for calculating an (n + 1)th order approximation to a zero of f (x): indeed,
setting x1 = xn+1, x0 = xn , and x1 = xn,1 we have
x n , x n,
xn+1 = xn , f (xn ) f (x ) , f (x )1
n n,1
Example 8.1. Write a Maple routine that utilizes the secant method to determine a zero of
f (x) = x3 , 4x + 1
starting with
x1 = 0
x2 = 1
M := 10;
delta := 0.000001;
epsilon := 0.000001;
f := x -> x^3 - 4*x + 1;
x0 := 0.0;
1
1. RATE OF CONVERGENCE OF SECANT METHOD 2
x1 := 1.0;
for i from 1 to M do
x2 := x1 - f(x1)*(x1 -x0)/(f(x1) -f(x0));
if (abs(f(x2)) < epsilon) then break; fi;
x0 := x1;
x1 := x2;
if (abs(x1 -x0) < delta) then break; fi;
od:
x2;
f(x2);
So
f (xn) = f 0 (r) + 1 f 00 (r)e + O ,e2
en 2 n n
and similarly
f (xn,1) = f 0 (r) + 1 f 00 (r)e + O ,e2
en,1 2 n,1 n,1
1. RATE OF CONVERGENCE OF SECANT METHOD 3
So we have
f (xn) , f (xn,1) = f 0 (r) + 1 f 00(r)e , f 0 (r) , 1 f 00(r)e + O ,e2
n n,1 n,1
en en,1 2 2
= 12 f 00 (r) (en , en,1 ) + O e2n,1
,
and 1 00
xn , xn ,1 2 f ( r )( en , en,1 )
en+1 f (x ) , f (x ) xn , xn,1 en en,1
n n,1
Now
en , en,1 = (xn , r) , (xn,1 , r) = xn , xn,1
and for xn and xn,1 suciently close to r
xn , xn,1 f 0 (r)
f (xn ) , f (xn,1)
So
(8.1) en+1 [f 0 (r)] 12 f 00 (r) en en,1 = Cenen,1
In order to determine the order of convergence, we now suppose an asymptotic relationship of the form
jen+1 j A jen j
This relationship also requires
jen j A jen,1j ) jen,1 j = A,1 jen j 1=
,
or
A jen j = CA, 1 jen j1+
1
or
A1, 1 = je j1,+ a1
C n
Now the left hand side is a product of constants. Therefore the right hand side must also be constant as
n ! 1. For this to happen we need
p p
1
0= 1,+ ) ,,1 = 0 ) =2 1 1 + 4 = 1 5
2 2 2
Taking the positive root (otherwise, the error terms asympotically diverge), we nd
1:62 < 2
Thus, the rate of convergence of the secant method is superlinear, but not quadratic.
Homework Problems
1. Show that
00
en+1 2jfjf 0((rr))jj en en,1 = Cen en,1