Secant Method Calculator

Root estimate1.52138
f(root) at the estimate0
Last step size3.11 x 10^-15
Iterations used8
How this was calculated
  1. The secant method replaces the curve with the straight line through the last two points and jumps to where that line crosses zero. From x0 = 1 and x1 = 2 with f(x1) = 4, the first jump lands at x2 = 1.3333.
  2. Unlike bisection, the secant method needs no bracket and usually converges much faster: the error shrinks with order about 1.618, the golden ratio, once the iterates get close to the root.
  3. After 8 iterations the estimate is 1.52138 with f(root) = 0. The last step moved only 0, a practical sign the estimate has settled.
  4. The trade-off is safety: with a poor starting pair the secant line can throw the next guess far away or hit a zero denominator, where bisection would have ground on reliably.

The Secant Method Calculator applies the secant method to find a root of an equation, showing the estimate together with the iterations that produced it. Given an equation and two starting guesses, it runs the method and reports where the estimates settle. For example, applied to x^3 - x - 2 with guesses of 1 and 2, it finds the root as 1.52138 in 8 iterations. For x^3 - 2x - 5 it converges to 2.09455 in 10 iterations. Applied to x^2 - 612 it returns 24.73863, the square root of 612. You can check that an estimate has settled by watching how far the last step moves: in the first example that step was only 3.11 x 10^-15.

The secant method is the accepted standard for this kind of calculation because it needs no bracket around the root, unlike bisection, so you can start from two guesses that may lie on the same side. Once the iterates get close to the root, its convergence order is about 1.618, the golden ratio, which is why the examples above settle in 8 or 10 iterations. This page shows the formula, the step-by-step workings for each iteration, worked examples and the sources behind them, so you can follow every estimate rather than just read the final answer.

Worked examples

Cubic root

(1 · 0 · -1 · -2 · 1 · 2 · 8)

Root estimate1.52138
f(root) at the estimate0
Last step size3.11 x 10^-15
Iterations used8

Wallis cubic

(1 · 0 · -2 · -5 · 2 · 2.5 · 10)

Root estimate2.09455
f(root) at the estimate0
Last step size0
Iterations used10

Square root of 612

(0 · 1 · 0 · -612 · 10 · 30 · 12)

Root estimate24.73863
f(root) at the estimate0
Last step size0
Iterations used12

How the secant method works

The secant method is a root-finding routine that trades a guaranteed bracket for speed. Instead of insisting that the root be trapped between two points of opposite sign, it simply takes the last two estimates, draws the straight line through them, and uses where that line crosses zero as the next estimate. The curve is replaced by a chord, and the chord's x-intercept becomes the new point. The old point drops away, the new one joins the pair, and the process repeats. A secant method calculator automates exactly this loop, so you can watch each chord and each intercept appear in turn.

To see the first jump, take the function x^3 - x - 2 with starting guesses of 1 and 2. At x = 1 the function equals 1 - 1 - 2 = -2; at x = 2 it equals 8 - 2 - 2 = 4. The line through (1, -2) and (2, 4) has a slope of 6, and it crosses zero a sixth of the way from 1 toward 2, giving a first new estimate of about 1.1667. That single step already replaces the guess at 1, and the next chord is drawn through 1.1667 and 2. Continuing this way, the method finds the root of x^3 - x - 2 as 1.52138 in 8 iterations from guesses of 1 and 2.

The same recipe works on other functions without any change in procedure. For x^3 - 2x - 5 it converges to 2.09455 in 10 iterations. Applied to x^2 - 612 it returns 24.73863, the square root of 612. In each case the only inputs are two starting guesses and the function itself; no interval containing the root has to be located first. That is the practical difference from bisection, which needs a bracket around the root before it can begin.

Once the iterates get close to the root, the method speeds up. Its convergence order is about 1.618, the golden ratio, so the number of correct digits grows by roughly that factor from one step to the next. The final steps therefore tend to be tiny. In the first example the last step moved only 3.11 x 10^-15, a sign the estimate had settled. Watching the size of successive steps is a simple way to judge when to stop.

The secant method needs no bracket around the root — just two starting guesses. For x^3 - x - 2 from guesses of 1 and 2, it reaches 1.52138 in 8 iterations.

Secant versus bisection and Newton

Choosing a root-finding method comes down to a trade-off between speed, reliability, and how much information you can supply. A secant method calculator sits in the middle of that trade-off. Bisection is the cautious option: it keeps a bracket around the root and halves the interval each step, so it always converges but advances slowly. Newton's method is the aggressive option: it uses the derivative to take big, well-aimed steps and converges quadratically once close to the root, but it requires that derivative and can misbehave when the derivative is small or the starting guess is poor. The secant method borrows Newton's idea of following the local slope but estimates that slope from two recent points instead of a formula, which is why it needs no derivative at all.

Once the iterates get close to the root, the secant method's convergence order is about 1.618, the golden ratio. That places it clearly ahead of bisection's steady halving and behind Newton's quadratic convergence, a sensible compromise for a method that asks only for two starting guesses. The price of that speed is that, unlike bisection, the secant method needs no bracket around the root, so it can wander or fail on badly behaved functions. Bisection gives you a guarantee; the secant method gives you speed with fewer requirements.

The examples show how quickly it settles in practice. Starting from guesses of 1 and 2, it finds the root of x^3 - x - 2 as 1.52138 in 8 iterations. The final step in that run moved only 3.11 x 10^-15, a sign the estimate had settled. For x^3 - 2x - 5 it converges to 2.09455 in 10 iterations. Applied to x^2 - 612 it returns 24.73863, the square root of 612. In each case two guesses and a handful of steps were enough, with no derivative and no bracket required.

Use these contrasts to pick the right tool. If you can bracket a root and want certainty, bisection is hard to beat. If you have an easy derivative and a good starting point, Newton's method will usually finish fastest. When the derivative is inconvenient or unavailable and you still want better-than-bisection speed, the secant method is the practical middle ground. A secant method calculator lets you run that comparison directly: enter two guesses, watch the iterates close in, and check the size of the last step as evidence that the estimate has settled.

  • Bisection: keeps a bracket, halves the interval each step, always converges but slowly.
  • Secant: needs no derivative and no bracket, with convergence order about 1.618 near the root.
  • Newton: uses the derivative for quadratic convergence, but depends on that derivative and a good guess.
  • Example: x^3 - x - 2 gives 1.52138 in 8 iterations from guesses of 1 and 2.
  • Example: x^3 - 2x - 5 converges to 2.09455 in 10 iterations.
  • Example: x^2 - 612 returns 24.73863, the square root of 612.
The secant method's convergence order of about 1.618, the golden ratio, beats bisection's halving and trails Newton's quadratic convergence, all without requiring a derivative.

Choosing starting guesses

The secant method does not need a bracket around the root the way bisection does, but that freedom puts more weight on your first two guesses. Those two points define the straight line used to produce the next estimate, so a pair that sits near the root — ideally with the root between them, or at least close by — gives the method a sensible direction to follow. A secant method calculator will run from almost any pair of numbers you enter, but the quality of that pair decides whether the answer arrives quickly or wanders off first.

The worked examples show what good guesses look like. Applied to x^3 - x - 2, the method finds the root as 1.52138 in 8 iterations from guesses of 1 and 2 — two values that straddle the root. For x^3 - 2x - 5 it converges to 2.09455 in 10 iterations. Applied to x^2 - 612 it returns 24.73863, the square root of 612. In each case the starting values were reasonable for the function, and the iteration count stayed modest. Once the iterates get close to the root, the convergence order is about 1.618, the golden ratio, so accuracy builds quickly in the final stages. In the first example, the last step moved only 3.11 x 10^-15, a sign the estimate had settled.

A poor pair can do real damage. If both guesses sit far from the root or on the same side of a steep, curving region, the line through them can point the next guess far away from where you want to be. Worse, if the two function values are equal, the denominator in the secant formula becomes zero and the next guess is undefined. That is the failure mode to watch for: identical or nearly identical function values at your two starting points.

Practical habits help. Pick two guesses that sit near the root, and check that the function values at those points are not equal. If you have a rough idea where the root lies, place one guess on each side of it. If you have no idea, plot or sample the function first, then choose a pair from the region where it crosses zero. Used this way, the secant method calculator is a fast, bracket-free tool — just remember that the starting guesses are the one part of the process you control.

Watch the denominator: if your two starting guesses give the same function value, the secant step divides by zero and the method cannot continue.

When the estimate has converged

A calculator that runs the secant method has to decide when to stop, and the most trustworthy stopping evidence comes from the function itself. When the estimate is close to the root, the function value at that estimate, f(root), should be close to zero. In the first example on this page, the method ends with f(root) = 0, which means the final estimate lands on a point where the function itself evaluates to zero. That is the strongest possible signal that the estimate has converged, and it is the kind of check a good secant method calculator reports alongside the answer rather than hiding.

The second piece of evidence is the size of the last step. Even when f(root) is not exactly zero, a step that barely moves the estimate tells you the iterates have settled. In that same first example, the last step moved only 3.11 x 10^-15. For a general audience, that number is worth putting in perspective: it is a change far smaller than anything meaningful in ordinary decimal work, so the estimate is effectively standing still. When both the residual is at or near zero and the last step is that tiny, you can present the result with confidence.

The other examples on this page show the same pattern in different problems. Applied to x^3 - x - 2 from guesses of 1 and 2, the method finds the root as 1.52138 in 8 iterations. For x^3 - 2x - 5 it converges to 2.09455 in 10 iterations. Applied to x^2 - 612 it returns 24.73863, the square root of 612. In each case the iteration count and the final estimate are the concrete record of convergence, and the residual and last step are the checks that back them up.

Why does the method settle so quickly once it is close? Its convergence order is about 1.618, the golden ratio, once the iterates get close to the root. That means each step roughly multiplies the number of correct digits by that factor, so the last few steps shrink very fast — which is exactly why a last step of 3.11 x 10^-15 is plausible rather than surprising. It also explains why the iteration counts above stay in the single digits to low double digits.

One practical note: unlike bisection, the secant method needs no bracket around the root. That freedom is convenient, but it also means the method can wander if the starting guesses are poor. So treat the residual and the last step as your stopping evidence, and treat a large last step or a residual far from zero as a reason to keep iterating or to try different guesses.

Converged when f(root) is at or near zero and the last step is tiny — in the first example, f(root) = 0 and the last step was 3.11 x 10^-15.

FAQs

What is the secant method?

The secant method is a root-finding iteration that jumps to where the line through the last two points crosses zero. Rather than using a derivative, it draws a secant line through two recent guesses and takes its zero crossing as the next guess. Applied to x^3 - x - 2, it finds 1.52138.

How fast does the secant method converge?

Once the iterates are close to the root, the secant method converges with order about 1.618, the golden ratio. That is slower than Newton's method's quadratic order but faster than bisection's linear order, and it needs no derivative, which makes each step cheap.

Does the secant method need a bracket?

No bracket is needed, unlike bisection, which requires the root to be trapped between two points of opposite sign. The secant method works from any two starting guesses. The tradeoff is that a poor starting pair can make the iteration diverge instead of settling on a root.

How many iterations does it take?

It depends on the function and the starting guesses. The examples on this page converge in 8, 10 and 12 iterations, each reaching residuals of 0. Fewer iterations usually mean the starting pair was closer to the root or the function behaved more gently near it.

Can it find a square root?

Yes. A square root can be written as a root of a simple polynomial, and the secant method solves it like any other root-finding problem. Solving x^2 - 612 = 0 gives 24.73863, which is the square root of 612.

What if the two function values are equal?

If the two function values are equal, the denominator in the secant step is zero and the iteration cannot proceed. The method has no valid line to extend to a zero crossing. In that case, choose a different second guess so the two function values differ.

Sources

Related calculators

Bisection Method Calculator
Bisection method root finding for a cubic over a bracket, with the guaranteed error bound, final bracket and f(root) after a fixed number of iterations.
Newton's Method Calculator
One step of Newton's method on f(x) = x squared minus 2, with the value at the new guess and how many steps it takes to reach the square root of 2.
Euler Method Calculator
Euler's method for three textbook differential equations with exact solutions for comparison: the numerical estimate at your target x, absolute and relative error and step size, over as many steps as you choose.