Secant Method Calculator for Polynomial Roots

Enter a real polynomial and two starting values to estimate one of its real roots with the secant method. The results show every update along with the step size, residual, and checks that prevent a small step from being treated as a root by itself.

Your numbers
Choose the highest power included in the polynomial.
Used only when quartic is selected.
Used for cubic and quartic polynomials.
Enter zero when the polynomial has no squared term.
Enter zero when the polynomial has no linear term.
This is the term independent of x.
Enter the first of two distinct initial root estimates.
Enter the second initial estimate, preferably near the desired root.
Iteration stops only after the absolute change in x is within this limit.
This scale-aware limit compares the step with the size of the current estimate.
The absolute polynomial value must also fall within this limit.
Sets a hard limit for divergent or slowly converging runs.

What this calculator leaves out

  • The secant method is not guaranteed to converge and can approach a root outside the interval between the starting values.
  • A small step alone does not prove that the residual is small, so this calculator checks both before reporting convergence.
  • This calculator uses floating-point arithmetic for real quadratic, cubic, and quartic polynomials; it does not search for complex roots or replace numerical-analysis judgment.

By using this calculator you agree to the Terms of Use. Results are estimates, not professional advice.

Estimated root1.521379707

Residual |f(x)|
1.820766e-14
Absolute step error
1.180307e-9
Relative step error
7.758137e-8%
Iterations
7
Observed convergence order
1.629199224
Convergence status
Converged
Iteration table
nxₙ₋₁xₙf(xₙ₋₁)f(xₙ)xₙ₊₁Absolute stepRelative stepResidual
112-241.3333333330.666666666750%0.962962963
221.3333333334-0.9629629631.4626865670.12935323388.843537415%0.3333388748
31.3333333331.462686567-0.962962963-0.33333887481.5311694320.068482864984.472585694%0.05862641771
41.4626865671.531169432-0.33333887480.058626417711.5209264210.010243011630.6734718713%0.002693300202
51.5311694321.5209264210.05862641771-0.0026933002021.5213763170.00044989615450.02957165492%0.00002015019239
61.5209264211.521376317-0.002693300202-0.000020150192391.5213797080.0000033913151280.0002229105009%7.015478e-9
71.5213763171.521379708-0.000020150192397.015478e-91.5213797071.180307e-97.758137e-8%1.820766e-14

Convergence requires both the combined absolute and relative step limit and the residual limit.

The displayed root is a real root estimate for the selected polynomial only.

How to use this calculator

  1. Choose whether the polynomial is quadratic, cubic, or quartic, then enter coefficients down to the constant term.
  2. Enter two different starting values near the real root you want to investigate.
  3. Set step and residual tolerances to match the precision that matters for your problem.
  4. Read the convergence status and the final residual before relying on the estimated root.
  5. Use the iteration table to check whether the estimates are settling, oscillating, or moving toward another root.

How the secant method finds a polynomial root

For the selected degree m, the calculator evaluates f(x) = a₀ + a₁x + a₂x² + ... + aₘxᵐ. A root is an x-value where that polynomial is zero. Starting from two different estimates, the secant method draws the line through (xₙ₋₁, f(xₙ₋₁)) and (xₙ, f(xₙ)), then uses that line's x-intercept as the next estimate.

The update is:

xₙ₊₁ = xₙ − f(xₙ) × (xₙ − xₙ₋₁) ÷ (f(xₙ) − f(xₙ₋₁))

Unlike Newton's method, this does not require entering or differentiating the polynomial. Unlike bisection, the two starting values do not have to surround a sign change. That freedom can be useful, but it means the path can leave the interval, settle on a different root, or fail to settle at all.

How this calculator decides whether it converged

Every update reports the absolute step Aₙ₊₁ = |xₙ₊₁ − xₙ|, the relative step Rₙ₊₁ = Aₙ₊₁ ÷ max(1, |xₙ₊₁|), and the residual Fₙ₊₁ = |f(xₙ₊₁)|. It declares convergence only when the step satisfies Aₙ₊₁ ≤ T_abs + T_rel × |xₙ₊₁| and the residual is at most T_res.

That second check matters. A sequence can take a very small step because the secant line has become nearly horizontal, while the polynomial value is still not close to zero. The calculator also stops with a warning if the two function values make a zero or numerically indistinguishable secant denominator.

What changes the result most

The two starting values influence which root the method reaches and whether it reaches one. Values near a simple real root usually behave better than distant guesses. A repeated root often converges more slowly, and coefficient rounding can change a nearly multiple root substantially. The observed convergence order uses the last three usable step sizes; near a well-behaved simple root it may approach about 1.618, but it is only a diagnostic, not a guarantee.

What this calculator leaves out

This tool works with real quadratic, cubic, and quartic polynomials only. It does not find complex roots, prove that every real root has been found, choose starting values for you, or replace a bracketing method when a guaranteed real-root interval is required. Its arithmetic uses ordinary floating-point numbers, so precision near machine limits is limited.

Worked example

For f(x) = x³ − x − 2, select a cubic and enter coefficients 1, 0, −1, and −2 for the x³ through constant terms. With starting values 1 and 2, the first secant update is x₂ = 2 − 4 × (2 − 1) ÷ (4 − (−2)) = 1.333333333.

The following updates move through about 1.462686567, 1.531169432, and 1.520926421 before settling at approximately 1.521379707. With all three default tolerances set to 1e-8, the calculator reports convergence only once the step and |x³ − x − 2| are both small enough.

Common questions

What is the secant method?

The secant method is an iterative way to approximate a zero of a function. It uses the line through the two most recent function values to estimate the next x-intercept, so it does not need an explicit derivative.

How should I choose the two starting values?

Choose two distinct values reasonably near the real root you want. A sign change between them can be a useful clue that a root lies between them, but the secant method does not preserve that bracket and can still move outside it.

Does the secant method require the starting values to bracket a root?

No. It can start from any two distinct real values for which the polynomial can be evaluated. Bisection, in contrast, needs a sign-changing bracket and keeps that bracket, which makes it more conservative.

Why can the secant denominator become zero?

The update divides by the difference between the two function values. When those values are equal or too close relative to floating-point precision, the secant line is effectively horizontal and its x-intercept cannot be calculated reliably.

Why is the observed order not exactly 1.618?

The usual order near a simple root is asymptotic, meaning it describes behavior only after the iterates are already close to the root. Early steps, rounded arithmetic, repeated roots, and unsuitable step ratios can all make a short-run estimate differ substantially.

What is the difference between step error and residual?

The step error measures how much the estimate changed from the previous iteration. The residual measures how close the polynomial value is to zero at that estimate. A reliable stopping rule checks both because either one alone can be misleading.

Put this calculator on your site

Paste the snippet below where you want the calculator to appear. It stays up to date automatically and links back here.

<iframe src="https://countfolk.com/embed/secant-method-polynomial-root-calculator/" title="Secant Method Calculator for Polynomial Roots" width="100%" height="640" style="border:0;max-width:44rem" loading="lazy"></iframe>