The secant method provides a simple way to approximate solutions of when the derivative is unavailable or difficult to compute. It requires two initial guesses, and , which need not bracket a root. Instead of evaluating the derivative directly, the secant method approximates it by the slope of the secant line through the points and . This slope is . The next approximation is obtained by computing the x-intercept of that secant line.
Algebraically, the iteration formula is . Because this formula uses only function evaluations, it avoids the derivative required in Newton’s method. However, it generally converges more slowly—about one order per iteration—while Newton converges quadratically when it works.
The secant method is especially useful when is expensive to differentiate or when the derivative is complicated. For instance, if represents a measured phenomenon with no simple analytic form, derivative estimates may be noisy. The secant method sidesteps that difficulty by using a finite difference approximation. As long as the guesses are reasonably close to a simple root, the sequence often converges.
To see why the method works, imagine drawing a secant through and . The point where this line intersects the x-axis predicts the location of the root, assuming behaves nearly linearly near the intersection. The new approximation becomes one of the points for the next iteration, gradually honing in on the solution. If and is smooth, the method often converges to a nearby root.
However, the secant method is not guaranteed to converge. If the function is highly nonlinear or the starting guesses are poor, the approximations may diverge or wander far from the root. To mitigate this, one can combine the secant method with bracketing methods such as bisection, switching algorithms when iterates leave a safe interval. Hybrid approaches retain the speed of the secant method when it works while ensuring reliability.
Despite these caveats, the secant method remains popular because each iteration requires only one function evaluation after the first. In contrast, Newton’s method requires both a function and its derivative at each step. When derivative computation is costly, the secant method often yields a faster overall solution despite its slower convergence rate per iteration.
This calculator implements the secant iteration directly. Supply your function using math.js
syntax. Then enter two initial guesses and , along with a tolerance and a maximum number of iterations. On submission, the script repeatedly applies the secant formula until consecutive approximations differ by less than the tolerance or until the iteration limit is reached. The final estimate and the number of iterations taken are displayed.
Experiment with different starting points to see how convergence changes. For smooth functions where the derivative does not vanish near the root, the secant method can converge quite rapidly. It is also instructive to compare its behavior with the Newton-Raphson method by running both calculators on the same function and initial points. Observing when the secant method succeeds or stalls builds intuition for selecting numerical techniques in practice.
Because the method relies solely on function values, it serves well in scenarios where the function is noisy or derived from external simulations. Simply evaluate the function at the current iterates, compute the secant slope, and advance to the next estimate. The simplicity of the formula makes it easy to implement and explains its enduring presence in numerical analysis texts.
Determine how a solute lowers the freezing point of a solvent using ΔTf = i Kf m.
Evaluate the beta distribution's PDF and CDF for given parameters.
Compute any variable of the ideal gas law (PV=nRT) using this convenient calculator. Enter values for three of the variables and quickly solve for the fourth. Useful for chemistry and physics students.