Secant method for f(x) = 0

The secant method is obtained from Newton's method by approximating the derivative of f(x) at two points xn and xn-1 by
           f(xn) - f(xn-1)
   f'(x) = --------------
              xn - xn-1
Geometrically, Newton's method uses the tangent line and the secant method approximates the tangent line by a secant line.

This gives the iteration scheme

                          
               f(xn)(xn - xn-1)    
   xn+1 = xn -  -------------- 
               f(xn) - f(xn-1)
                        
The secant method has superlinear convergence (approximately 1.6, compared to 2 for Newton's method). When the secant method converges it usually does so in 5 to 7 iterations if the initial guesses are good enough.

Back to Secant method program