The Secant Method
Finding roots without derivatives: A practical alternative to Newton's Method.
⚡ Convergence Recap
Recall that a sequence converges with order $r$ if $\lim_{k\rightarrow\infty} \frac{|e_{k+1}|}{|e_{k}|^{r}} = C$.
Adds roughly one digit of accuracy per step (e.g., Bisection).
Doubles the number of correct digits per step (e.g., Newton's).
The Secant Method
Newton's method is great, but calculating $f'(x)$ can be expensive or impossible. The Secant Method approximates the derivative using two previous points.
Derivation
Approximate the derivative:
Substitute into Newton's formula:
⚠️ Stability Note
While mathematically equivalent to $x_{k+1} = \frac{f(x_k) x_{k-1} - f(x_{k-1}) x_k}{f(x_k) - f(x_{k-1})}$, using the update form $x_{k+1} = x_k + \Delta$ is better to avoid catastrophic cancellation when $x_k \approx x_{k-1}$.
Algorithm & Performance
Secant Algorithm
Convergence Comparison
Solve $x - x^{1/3} - 2 = 0$.
| k | Newton Error | Secant Error |
|---|---|---|
| 1 | $4.5 \times 10^{-3}$ | $3.5 \times 10^{-3}$ |
| 2 | $3.8 \times 10^{-7}$ | $3.1 \times 10^{-5}$ |
| 3 | $2.7 \times 10^{-15}$ | $2.0 \times 10^{-9}$ |
| 4 | 0.0 | $1.3 \times 10^{-15}$ |
Secant is slightly slower ($r \approx 1.62$) but requires no derivative!
When Secant Fails
Like Newton's method, Secant method assumes the function is locally linear.
- Flat Spots: If $f(x_k) \approx f(x_{k-1})$, the denominator approaches zero, shooting the next guess to infinity.
- Poor Guesses: If initial points are not close to the root, it may diverge.
- No Bracketing: Unlike Bisection, it doesn't guarantee the root stays bracketed.
MATLAB's fzero
fzero is a robust hybrid solver. It combines the best of all worlds:
Reliable backup if others fail.
Fast convergence.
Even faster using 3 points.
Reverse Quadratic Interpolation (RQI)
Instead of a straight line (Secant), RQI fits a sideways parabola ($x = ay^2 + by + c$) through three points to find where it hits the x-axis ($y=0$).
Usage Example
🧠 Final Challenge +20 XP
Why might one choose the Secant Method over Newton's Method?