ROOT FINDING TECHNIQUES: Secant Method

Consider a function f ( x ) which has the following graph:

Suppose that we want to locate the root r which lies near the points x0 and x1. The main idea in secant method is to approximate the curve with a straight line for x between the values of x0 and r. The straight line is assumed to be the secant which connects the two points ( x0, f(x0) ) and (x1, f(x1) ). Graphically we can represent this with the picture below, where the secant line and the new root estimate x2 are shown in red.

We can see that x2 is closer to the root r than either x1 or x0. If we were to repeat the process we can very easily see that x3 would be even closer to the root as it is shown below in green.

Analytically how can we obtain x2 if we know x0 and x1? Let’s try to write the equation of the red straight line. Its slope m is given by

and its equation is:

The point x = x2 corresponds to the point of the straight line where y = 0. Consequently we obtain:

If we solve this equation for x2 we obtain the iteration formula:

As an example of the method consider the following table which illustrates the steps needed to find the positive root of

x2 – 2 = 0

We start with the initial guesses x0 = 2 and x1 = 1.8 .

x0 x1
f(x0)
f(x1)
m x2 remark
2
1.8
2

1.24

3.8
2 – 2 / 3.8 =

1.4737

We now go to next line by shifting x1 to x0 and x2 to x1 (follow the colors)
1.8
1.4737
1.24
0.1718
3.2737
1.8. – 1.24 / 3.2737 =

1.4212

We also shift f(x1) to f(x0) only one function evaluation per line
1.4737
1.4212
0.1718
0.0198
2.8952
1.4737-0.1718 / 2.8952 =

1.4144

Shift again. The root is approaching its exact value
1.4212
1.4144
0.0198
0.0005
2.8382
1.4212-0.0198/2.8382=

1.4142

At this point we reach the “exact” value considering 4 decimal digits

Note that the actual root of the equation is the square root of two, which is 1.414213562. If we round this value to 4 decimal places we have 1.4142. What is the error between this “exact” value and our approximation of the first, second, and third line of the table? Check to see how we dealt with this question in our study of Newton’s method and repeat the calculations for this example.

Here we want to illustrate another point of the iteration procedures. How do we know when to stop since we normally don’t know the “exact” answer?

Look at the table below where we list the values of “smallness of f(x)” and “closeness of x” and you can see that if you set some tolerances ahead of time, then you can have an if statement which will decide whether the iteration should stop. WARNING: You must also have a bound on the maximum number of iterations, to prevent the divergent cases from running forever.

Line number
(Indicated by n)
1
2
3
4

 

PROS & CONS of the method:

1) When the method works, works fast. It is a bit slower than Newton’s method but much faster than the bisection method

2) If we have the wrong starting values the method diverges ( produces increasingly nonsensical results)

3) We only need to calculate the function itself at each step only once.

Jacob Y. Kazakia © 2001 All rights reserved