Interactive Educational Modules in
Scientific Computing

Secant Method

This module demonstrates the secant method for solving a nonlinear equation f(x) = 0 in one dimension. Given two approximate solutions x0 and x1, the secant method produces a new approximate solution given by x1f(x1) (x1x0) ⁄ (f(x1) − f(x0)), which is the intersection of the secant line with the x axis. The new approximate solution replaces one of the old ones, and the process is repeated until convergence, which is usually quite rapid.

The user selects a problem either by choosing a preset example or typing in a desired function f(x). The user can also select two starting points x0 and x1 or accept default values. The successive steps of the secant method are then carried out sequentially by repeatedly clicking on NEXT or on the currently highlighted step. The current values of x and f(x) are indicated by bullets on the plot and are also shown numerically in the table below. At each iteration of the secant method, the approximating secant line at the current points is drawn, the next approximate solution is taken to be the intersection of the secant line with the x axis, and the process is then repeated. If the starting guesses are close enough to the true solution, then the secant method converges to it, typically with a superlinear convergence rate.

Reference: Michael T. Heath, Scientific Computing, An Introductory Survey, 2nd edition, McGraw-Hill, New York, 2002. See Section 5.5.4, especially Algorithm 5.3 and Example 5.12.

Developers: Jeffrey Naisbitt and Michael Heath