How to use the Secant Method Calculator
- 1. Enter f(x)Type the function whose root you want, for example x^3 − 2x − 5.
- 2. Give two starting valuesx₀ and x₁ should be near the root. They do not need to bracket it.
- 3. Read the rootEach row shows the two latest values, their f values and the next x.
How the secant method works
The secant method replaces the tangent of Newton-Raphson with the line through the last two points. Starting with x₀ and x₁, the next value is where that line crosses the x-axis:
xₙ₊₁ = xₙ − f(xₙ)(xₙ − xₙ₋₁) / (f(xₙ) − f(xₙ₋₁)).
Then drop the oldest point and repeat. It needs only one new function value per step and no derivative. Its order of convergence is about 1.618, faster than bisection and regula falsi but a little slower than Newton-Raphson. Unlike regula falsi, it does not keep the root bracketed, so it can fail if the starting values are far from the root.
Worked example
Find the root of x³ − 2x − 5 = 0 with x₀ = 2, x₁ = 3. f(2) = −1 and f(3) = 16, so x₂ = 3 − 16(3 − 2)/(16 + 1) = 2.05882. f(2.05882) = −0.39080, so x₃ = 2.05882 + 0.39080 × 0.94118/16.39080 = 2.08126.
Next x₄ = 2.09482, then x₅ = 2.09455 and x₆ = 2.09455. The root is x ≈ 2.0946, reached in 5 iterations for a tolerance of 0.0001.
Tips
If f(xₙ) and f(xₙ₋₁) become equal the line is flat and the method stops; choose other starting values. When you need a guaranteed bracket, use regula falsi or the bisection method.
Frequently asked questions
How is the secant method different from regula falsi?
Both use a chord. Regula falsi keeps one end on each side of the root; the secant method always uses the two latest points, which is faster but can diverge.
Do the starting values have to bracket the root?
No. They only need to be reasonably close to the root.
Why use it instead of Newton-Raphson?
It needs no derivative, which helps when f′(x) is hard to find or expensive to compute.
When does it stop?
When two successive values differ by less than your tolerance, or f(x) becomes exactly 0.
Is this calculator free?
Yes. You fill a short form once when you see your first result, and other Uncodemy tools then open without the form. Everything is calculated in your browser.