Numerical Methods · Learn
How to solve $f(x)=0$ when no formula exists — by guessing, then improving. Three classic methods, why one rearrangement converges while another explodes, and how fast each one closes in.
Find the root $x^*$ where $f(x^*)=0$. A few equations factor nicely; most — $\cos x = x$, $x e^x = 1$, a pressure-drop correlation — don't. So we build a sequence of guesses $x_0, x_1, x_2,\dots$ from a rule that drives them toward the root, and stop when successive guesses barely move. The questions that matter: does it converge, and how fast?
For a polynomial, the Fundamental Theorem of Algebra guarantees exactly $n$ roots (counting complex ones and multiplicity) — you always know how many to look for. For everything else, you don't get that guarantee. A transcendental equation might have one real root, several, none at all, or only complex ones — and there's no general theorem that tells you in advance. In practice this means domain knowledge does real work: knowing a wall thickness must be positive, or a temperature must sit between two physical bounds, is often the only thing narrowing "search everywhere" down to "bracket this interval and bisect." Without that context, even picking a good starting guess for Newton or secant is partly a guess about where a real root plausibly lives, not something the algorithm itself can tell you.
Rewrite $f(x)=0$ algebraically as $x = g(x)$. A root is now a fixed point — a value the map $g$ leaves unchanged. Iterate it:
Geometrically, a fixed point is where $y=g(x)$ meets the diagonal $y=x$. The iteration draws a cobweb: up to the curve, across to the diagonal, repeat. Whether it spirals in or staircases out depends entirely on the slope of $g$ at the root:
If $g$ is flatter than the diagonal there, errors shrink each step; if steeper, they grow. The convergence is linear — the error multiplies by roughly $|g'(x^*)|$ each iteration.
This has a single real root, $x^*\approx 1.3247$. Rearrange it three different ways — all algebraically identical — and watch their fates diverge:
| Rearrangement $g(x)$ | $|g'(x^*)|$ | Result |
|---|---|---|
| $x = x^3 - 1$ | ≈ 5.3 | diverges |
| $x = (x+1)^{1/3}$ | ≈ 0.19 | converges |
| $x = 1/(x^2-1)$ | ≈ 4.6 | diverges |
Same equation, opposite outcomes — the rearrangement is everything. There's no guarantee any given $g$ works; part of the craft is finding one that does.
Switch between these three with the preset chips and watch the cobweb spiral in or staircase to infinity, with the live $|g'|$ readout telling you which side of 1 you're on. Open the lab →
Don't guess a rearrangement — use the function's own slope. Stand at $x_n$, follow the tangent line down to where it crosses the axis, and land at $x_{n+1}$:
Newton's method is famously fast: near a simple root the number of correct digits roughly doubles every step — quadratic convergence. The price: you need the derivative, and a poor starting guess can send it wandering. (At a flat spot, $f'\to 0$, the tangent is nearly horizontal and the step blows up.)
What if you don't have $f'$? Replace the tangent with the line through your last two points — a finite-difference stand-in for the derivative:
No derivative needed, and only one new function evaluation per step. Its convergence order is the golden ratio $\varphi\approx 1.618$ — slower than Newton but often cheaper overall, which is why it's a workhorse in practice.
| Method | Needs | Speed | Watch out for |
|---|---|---|---|
| Fixed-point | a good $g(x)$ | linear | $|g'|\ge 1$ → diverges |
| Newton | $f$ and $f'$ | quadratic | $f'\approx 0$, bad start |
| Secant | $f$ only | ≈1.6 (superlinear) | nearly equal $f$ values |
In the lab, derivatives for Newton are estimated numerically, so you only ever type the function itself.
A real-world example: the zeros of a Bessel function are exactly this kind of root-finding problem, just on a transcendental special function instead of a polynomial — and those roots are physically meaningful (a drumhead's allowed frequencies). So are the eigenvalues of β tan β = Nu in the Solar Heat Exchanger Design worked example — bracket-and-bisect is exactly how that paper's eigenvalue table was generated. The Concentric Cylinders worked example pushes further: five different methods on one equation, plus Steffensen's method turning a painfully slow fixed-point iteration into one of the fastest options.
EngineeringCandy · Learn · the theory behind the playground