0% found this document useful (0 votes)
188 views

The Secant Method

The secant method is a technique for numerically finding the root of a function when no information about the derivative exists. It converges faster than the false position method. The method begins with two initial guesses and uses their function values to calculate the x-intercept of the line between the two points, which gives a closer approximation. The example shows applying this to finding the root of f(x) = cos(x) + 2sin(x) + x^2, converging after 6 iterations to -0.6595.

Uploaded by

nick bandiola
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
188 views

The Secant Method

The secant method is a technique for numerically finding the root of a function when no information about the derivative exists. It converges faster than the false position method. The method begins with two initial guesses and uses their function values to calculate the x-intercept of the line between the two points, which gives a closer approximation. The example shows applying this to finding the root of f(x) = cos(x) + 2sin(x) + x^2, converging after 6 iterations to -0.6595.

Uploaded by

nick bandiola
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

THE SECANT METHOD

The secant method is a technique for finding the root of a scalar-valued function f(x) of a single
variable x when no information about the derivative exists. It is similar in many ways to the false-
position method, but trades the possibility of non-convergence for faster convergence.

As an example of the secant method, suppose we wish to find a root of the function
f(x) = cos(x) + 2 sin(x) + x2. A closed form solution for x does not exist so we must use a
numerical technique. We will use x0 = 0 and x1 = -0.1 as our initial approximations. We will let
the two values εstep = 0.001 and εabs = 0.001 and we will halt after a maximum of N = 100
iterations.

We will use four decimal digit arithmetic to find a solution and the resulting iteration is shown in
Table 1.

Table 1. The secant method applied to f(x) = cos(x) + 2 sin(x) + x2.

n xn − 1 xn xn + 1 |f(xn + 1)| |xn + 1 - xn|


1 0.0 -0.1 -0.5136 0.1522 0.4136
2 -0.1 -0.5136 -0.6100 0.0457 0.0964
3 -0.5136 -0.6100 -0.6514 0.0065 0.0414
4 -0.6100 -0.6514 -0.6582 0.0013 0.0068
5 -0.6514 -0.6582 -0.6598 0.0006 0.0016
6 -0.6582 -0.6598 -0.6595 0.0002 0.0003
Thus, with the last step, both halting conditions are met, and therefore, after six iterations, our
approximation to the root is -0.6595.

The Newton-Raphson algorithm requires the evaluation of two functions (the function and its
derivative) per each iteration. If they are complicated expressions it will take considerable amount of
effort to do hand calculations or large amount of CPU time for machine calculations. Hence it is
desirable to have a method that converges (please see the
section order of the numerical methods for theoretical details)
as fast as Newton's method yet involves only the evaluation of
the function. Let x0 and x1 are two initial approximations for the
root 's' of f(x) = 0 and f(x0) & f(x1) respectively, are their
function values. If x 2 is the point of intersection of x-axis and
the line-joining the points (x0, f(x0)) and (x1, f(x1)) then x2 is
closer to 's' than x0 and x1. The equation relating x0, x1 and x2 is
found by considering the slope 'm'

f(x1) - f(x0) f(x2) - f(x1) 0 - f(x1)


m = = =
x1 - x0 x2 - x1 x2 - x1
- f(x1) * (x1-x0)
x2 - x1 =
f(x1) - f(x0)

f(x1) * (x1-x0)
x2 = x1 -
f(x1) - f(x0)

or in general the iterative process can be written as

f(xi) * (xi - xi-1 )


xi+1= xi - i = 1,2,3...
f(xi) - f(xi-1)

This formula is similar to Regula-falsi scheme of root bracketing methods but differs in the
implementation. The Regula-falsi method begins with the two initial approximations 'a' and 'b'
such that a < s < b where s is the root of f(x) = 0. It proceeds to the next iteration by
calculating c(x2) using the above formula and then chooses one of the interval (a,c) or (c,h)
depending on f(a) * f(c) < 0 or > 0 respectively. On the other hand secant method starts with two
initial approximation x0 and x1 (they may not bracket the root) and then calculates the x2 by the
same formula as in Regula-falsi method but proceeds to the next iteration without bothering
about any root bracketing.

You might also like