In numerical analysis, the secant method is a root-finding algorithm that uses a succession of roots of secant lines to better approximate a root of a function f. The secant method can be thought of as a finite-difference approximation of Newton's method, so it is considered a quasi-Newton method. Historically, it is as an evolution of the method of false position, which predates Newton's method by over 3000 years.
The method The secant method is an iterative numerical method for finding a zero of a function f. Given two initial values x0 and x1, the method proceeds according to the recurrence relation
x n = x n − 1 − f ( x n − 1 ) x n − 1 − x n − 2 f ( x n − 1 ) − f ( x n − 2 ) = x n − 2 f ( x n − 1 ) − x n − 1 f ( x n − 2 ) f ( x n − 1 ) − f ( x n − 2 ) . {\displaystyle x_{n}=x_{n-1}-f(x_{n-1}){\frac {x_{n-1}-x_{n-2}}{f(x_{n-1})-f(x_{n-2})}}={\frac {x_{n-2}f(x_{n-1})-x_{n-1}f(x_{n-2})}{f(x_{n-1})-f(x_{n-2})}}.}
This is a nonlinear second-order recurrence that is well-defined given f and the two initial values x0 and x1. Ideally, the initial values should be chosen close to the desired zero.
Derivation of the method Starting with initial values x0 and x1, we construct a line through the points (x0, f(x0)) and (x1, f(x1)), as shown in the picture above. In point–point form, the equation of this line is
y = f ( x 1 ) − f ( x 0 ) x 1 − x 0 ( x − x 1 ) + f ( x 1 ) . {\displaystyle y={\frac {f(x_{1})-f(x_{0})}{x_{1}-x_{0}}}(x-x_{1})+f(x_{1}).}
The root of this linear function, that is the value of x such that y = 0 is
x = x 1 − f ( x 1 ) x 1 − x 0 f ( x 1 ) − f ( x 0 ) . {\displaystyle x=x_{1}-f(x_{1}){\frac {x_{1}-x_{0}}{f(x_{1})-f(x_{0})}}.}
We then use this new value of x as x2 and repeat the process, using x1 and x2 instead of x0 and x1. We continue this process, solving for x3, x4, etc., until we reach a sufficiently high level of precision (a sufficiently small difference between xn and xn−1):
… excerpt ends here. Continue reading the full article.



