What the Secant Method Is For
The secant method finds a root of a function — a value of x where f(x) = 0 — without needing the function's derivative, unlike Newton's method. Instead, it approximates the slope between two nearby points on the curve using a straight secant line, and uses where that line crosses zero as the next, better guess. It repeats this process, using the two most recent guesses each time, until two consecutive guesses are closer together than your chosen tolerance.
This calculator applies the method specifically to a quadratic, f(x) = ax² + bx + c, so you can see the iteration converge on one of the quadratic's two real roots starting from two initial guesses you provide. It's useful for students learning numerical root-finding methods, or anyone who wants to see how an iterative method converges compared to the exact quadratic formula.
The Formula
xn+1 = xn − f(xn) × (xn − xn−1) ÷ (f(xn) − f(xn−1))
- xn−1, xn — your two most recent guesses (x0 and x1 to start).
- f(x) — the function being evaluated; here, f(x) = ax² + bx + c using the a, b, c you enter.
- xn+1 — the next, improved guess, found where the secant line through (xn−1, f(xn−1)) and (xn, f(xn)) crosses the x-axis.
- Tolerance — the iteration stops once |xn+1 − xn| is smaller than this value, treating the result as converged.
Worked Example
a = 1, b = −5, c = 6 (so f(x) = x² − 5x + 6, which factors exactly as (x−2)(x−3), with real roots at x = 2 and x = 3), x0 = 0, x1 = 4, tolerance = 0.000001.
- Iteration 1: f(0) = 6, f(4) = 2 → next guess = 4 − 2(4−0)/(2−6) = 6.0
- Iteration 2: f(4) = 2, f(6) = 12 → next guess = 3.6
- Iteration 3: f(6) = 12, f(3.6) = 0.96 → next guess ≈ 3.391
- Iterations 4-8 continue narrowing: 3.118 → 3.031 → 3.003 → 3.0001 → 3.00000029
- Iteration 9: the guess reaches 3.0000000000269, and the change from the previous guess is below the 0.000001 tolerance, so it converges
Final result: Estimated Root = 3.00000000, Iterations Used = 9, Residual |f(x)| ≈ 2.695e-11, Convergence Status = Converged. Note the method converged to the root at x = 3, not x = 2 — which root a secant search finds depends entirely on which two starting guesses you choose.
Common Mistakes / How to Interpret the Result
- Assuming it will find every root. The secant method converges to whichever root is "nearest" in behavior to your starting guesses — a quadratic has up to two real roots, and different x0/x1 starting pairs can converge to different ones (or the same one).
- Picking starting guesses where f(x0) equals f(x1). If the two starting points happen to give equal function values, the denominator in the formula is zero and the method can't take a step — the calculator reports a near-singular step if this happens during iteration.
- Setting tolerance too loose or Max Iterations too low. A loose tolerance can report "converged" before the estimate is actually accurate; too few max iterations on a slowly-converging start can cut off before convergence, reporting "Max iter" instead of "Converged."
- Confusing the secant method with Newton's method. Newton's method uses the actual derivative f'(x) at one point; the secant method approximates that slope using two points and their function values instead, which is why it needs two starting guesses (x0 and x1) rather than one.
Related Calculators
- Newton-Raphson Root Finder Calculator — compare against the derivative-based method the secant method approximates.
- Quadratic Formula Calculator — get both exact roots of a quadratic directly, to check against the iterative result.
- Polynomial Roots Calculator — find roots of higher-degree polynomials beyond quadratics.