Most equations cannot be solved exactly. These methods find a root to any accuracy you like — and, just as importantly, tell you when they are about to fail.
Locating a root
If f is continuous on [a,b] and f(a) and f(b) have opposite signs, then f has a root somewhere between them.
Show that f(x)=x3−x−1 has a root between 1 and 2.
f(1)=1−1−1=−1f(2)=8−2−1=5
The sign changes from negative to positive, and f is a polynomial and therefore continuous, so a root lies in (1,2).
Interval bisection
Halve the interval, keep the half where the sign still changes, repeat.
Starting from (1,2) with f(x)=x3−x−1:
Midpoint
f(mid)
New interval
1.5
+0.875
(1,1.5)
1.25
−0.297
(1.25,1.5)
1.375
+0.225
(1.25,1.375)
Each step halves the width, so after n steps the interval is 2nb−a wide. From a width of 1, four bisections give 0.0625 — enough to fix the root to one decimal place.
Linear interpolation
Instead of taking the midpoint, join (a,f(a)) and (b,f(b)) with a straight line and take where that line crosses the axis:
x≈a+(b−a)∣f(a)∣+∣f(b)∣∣f(a)∣
For our example:
x≈1+1×1+51=1.167
This weights the estimate towards whichever end has the smaller function value — a better guess than the midpoint when the function is nearly straight, and a worse one when it curves sharply.
The Newton–Raphson method
xn+1=xn−f′(xn)f(xn)
Geometrically: take the tangent at your current estimate and follow it to the x-axis. That crossing point is the next estimate.
Apply it to f(x)=x3−x−1 starting from x0=1.5.
f′(x)=3x2−1
f(1.5)=0.875f′(1.5)=5.75
x1=1.5−5.750.875=1.3478
x2=1.3478−4.44990.1008=1.3252
x3=1.3247
The true root is 1.32472… — three steps for five significant figures, where bisection would have needed about fifteen.
Fixed-point iteration
Rearrange f(x)=0 into the form x=g(x), then iterate
xn+1=g(xn)
From x3−x−1=0 there are several rearrangements. Taking x3=x+1 gives
x=(x+1)1/3
Starting at x0=1:
x1=21/3=1.2599x2=1.3123x3=1.3223x4=1.3243
converging steadily to 1.3247.
But the rearrangement x=x3−1, from the same equation, diverges. Starting at x0=1.3:
x1=1.197x2=0.715x3=−0.634…
running away from the root entirely.
Accuracy and failure
When does iteration converge?
The iteration xn+1=g(xn) converges near a root if ∣g′(x)∣<1.
For g(x)=(x+1)1/3: g′(x)=31(x+1)−2/3, which near x=1.32 is about 0.19. Since 0.19<1, it converges ✓
For g(x)=x3−1: g′(x)=3x2, which near the root is about 5.3. Since 5.3>1, it diverges ✓
Confirming an answer
To show a root is 1.32 correct to 2 decimal places, evaluate f at 1.315 and 1.325 and demonstrate a sign change between them. Those are the bounds that round to 1.32.