The secant method is an iterative numerical technique for approximating solutions of the equation
f(x) = 0. It is similar to Newton's method but does not require an explicit derivative
f'(x). Instead, it estimates the derivative using the slope of a secant line through two
recent points on the graph of f(x).
This makes the method especially useful when the function is easy to evaluate but hard or expensive
to differentiate. Typical use cases include engineering models, applied physics, and numerical
analysis homework problems, where you only have a formula (or even empirical data) for f(x),
not for its derivative.
Suppose you want to solve f(x) = 0 and you have two initial guesses, x₀ and x₁,
that you believe are near a root. The secant method constructs a line through the points
(x₀, f(x₀)) and (x₁, f(x₁)) and then uses the intersection of this line with the
x-axis as the next approximation.
The approximate derivative from these two points is the secant slope
From this, the iteration formula for n ≥ 1 is
You start with x₀ and x₁, compute x₂ from the formula, then use
x₁ and x₂ to compute x₃, and so on, until successive approximations
become sufficiently close.
The calculator applies the iteration above automatically. To run it effectively, follow these steps:
f(x):
x^3 - x - 2, cos(x) - x, exp(x) - 5, x^2 + 3*x - 1.sqrt(x) for square roots, exp(x) for e^x, and functions like sin, cos, log, etc.x₀ and x₁:
1e-4 (0.0001), 1e-6, or 1e-8.
The final value returned by the calculator is an approximate root of f(x) = 0.
In practice, this means that f(x) evaluated at the reported value should be close to zero
within the chosen tolerance.
You can check the quality of the solution by:
f(x) at the reported root and verifying that its absolute value is small.f(x) near the root to confirm that the curve crosses the axis at (or very near) the computed point.If the results change dramatically when you adjust the initial guesses or tolerance, the problem may be ill-conditioned for the secant method, or there may be multiple nearby roots.
Consider the equation f(x) = x^3 - x - 2 = 0. This function has a real root slightly above 1.
We will apply the secant method with initial guesses x₀ = 1 and x₁ = 2.
f(1) = 1^3 - 1 - 2 = -2f(2) = 2^3 - 2 - 2 = 4
Using the secant update
x₂ = x₁ - f(x₁) * (x₁ - x₀) / (f(x₁) - f(x₀)), we have
x₂ = 2 - 4 * (2 - 1) / (4 - (-2)) = 2 - 4 / 6 = 1.333333...
f(1.3333) ≈ 1.3333^3 - 1.3333 - 2 ≈ -0.9629x₁ = 1.3333, x₂ ≈ 1.3333 and x₀ = 2 in the formula to get x₃.x ≈ 1.52138, which is the real root of
x^3 - x - 2 = 0.
If you enter x^3 - x - 2 as f(x), set x₀ = 1, x₁ = 2, and choose a
tolerance like 1e-6, the calculator should return a value very close to 1.52138.
The secant method occupies a middle ground between derivative-based methods and more robust bracketing methods. The table below compares it with Newton's method and the bisection method.
| Method | Needs derivative? | Convergence speed (when it works) | Guarantee of staying in an interval? | Typical use cases |
|---|---|---|---|---|
| Secant | No | Superlinear (faster than linear, slower than quadratic) | No explicit guarantee | When f(x) is easy to evaluate but f'(x) is hard or unknown |
| Newton's method | Yes | Quadratic near a simple root | No; can diverge or jump away from the root | Problems with a good initial guess and an analytic derivative |
| Bisection | No | Linear (relatively slow) | Yes, stays inside the initial bracketing interval | When you can find an interval where f changes sign and need guaranteed convergence |
While the secant method is simple and efficient, it has important limitations you should keep in mind when using this calculator:
x₀ = x₁, the secant slope is undefined and
the method cannot start. Always choose two different starting values.
f(xₙ) = f(xₙ₋₁), the denominator in
the update formula becomes zero. In practice, the calculator will stop or report a failure when this
happens.
f(x) = 0 and f'(x) = 0) or in very flat regions of the curve, the method can become
slow or unstable.
f(x) has jumps, vertical asymptotes, or
singularities between successive iterates, the secant line may give a very poor prediction. Always check
a graph of the function if you see strange behavior.
For critical engineering decisions or sensitive scientific computations, treat the calculator as a helper rather than a final authority. Cross-check with alternative methods or analytical solutions when possible.