Algorithms
JUN 2026

Secant Method

A root-finding algorithm that uses a succession of roots of secant lines to better approximate a root of a function. The secant method can be thought of as a finite-difference approximation of Newton's method. It does not require the calculation of derivatives, but it requires two initial guesses and has a slower convergence rate than Newton's method.

Historical Context

The Secant method is one of the oldest known root-finding algorithms, predating Newton's method by over 3000 years. It was used in a rudimentary form by Babylonian mathematicians to approximate roots.

In modern numerical analysis, it serves as an excellent alternative to Newton's method when the analytical derivative of the function is unknown, too costly to compute, or cannot be evaluated cleanly. By keeping track of the last two evaluated points, it effectively constructs a secant line to approximate the slope that Newton's method would obtain via the true tangent line.

Though its convergence rate of 1.618\approx 1.618 is lower than Newton's quadratic 22, it only requires one new function evaluation per iteration (as opposed to evaluating both f(x)f(x) and f(x)f'(x)), which often makes it faster in practice for complex functions.

Geometric Foundation: The Secant Line

Secant Intersection

By calculating the secant line between x0x_0 and x1x_1, we can follow its slope down to the x-axis to find x2x_2.
x₀x₁x₂
x2=x1f(x1)x1x0f(x1)f(x0)x_2 = x_1 - f(x_1)\frac{x_1 - x_0}{f(x_1) - f(x_0)}
f(x)=x32x5f(x) = x^3 - 2x - 5

Geometric View

xn+1=xnf(xn)xnxn1f(xn)f(xn1)x_{n+1} = x_n - f(x_n)\frac{x_n - x_{n-1}}{f(x_n) - f(x_{n-1})}
00.7001.402.102.803.50-10.0-5.0005.0010.015.020.0

Convergence Plot

IterError (Log)10^110^-110^-310^-5012345
Iter 0. Ready.
Iterx_n-1x_nf(x_n-1)f(x_n)x_n+1Error

Error Bound |x_n+1 - x_n|

--

Current State

No active state.

Algorithm

while |x_n+1 - x_n| > ε:if f(x_n) == f(x_n-1): breakx_n+1 = x_n - f(x_n) * (x_n - x_n-1) / (f(x_n) - f(x_n-1))x_n-1 = x_nx_n = x_n+1return x_n

Why it works

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 ff. It can be thought of as a finite-difference approximation of Newton's method. Instead of requiring the derivative of the function, which may be difficult or impossible to compute, it uses two initial points to estimate the tangent line with a secant line.

Mathematically, we approximate the derivative using the finite difference from the last two points:

f(xn)f(xn)f(xn1)xnxn1f'(x_n) \approx \frac{f(x_n) - f(x_{n-1})}{x_n - x_{n-1}}

Substituting this into Newton's method iteration formula gives the Secant iteration formula:

xn+1=xnf(xn)xnxn1f(xn)f(xn1)x_{n+1} = x_n - f(x_n)\frac{x_n - x_{n-1}}{f(x_n) - f(x_{n-1})}

Where the Secant Method Fails

Like Newton's Method, the Secant Method can fail if the function behaves poorly or if the initial guesses are far from the root.

  • Division by Zero: If the function values at the two points are identical (f(xn)=f(xn1)f(x_n) = f(x_{n-1})), the secant line is horizontal and never intersects the x-axis.
  • Runaway (Divergence): Like Newton's method, it can be thrown very far away if a secant line is nearly horizontal.
  • Convergence Rate: The secant method has a superlinear convergence rate (with order approximately ϕ1.618\phi \approx 1.618), making it faster than bisection but slightly slower than the quadratic rate of Newton's method.

Newton's method, but without the derivative. Can you feel the difference?

The secant line approximates the tangent. One fewer evaluation per step — and yet it converges at the golden ratio. Here's why that trade-off matters.

Output
Output will appear here after running the code
Output
Output will appear here after running the code
Need something guaranteed to converge?Bisection Method