Today's lesson
Learning intentions
- Use the bisection method to numerically locate a solution of $f(x)=0$ to a required accuracy
- Derive Newton's method as the $x$-intercept of a tangent line
- Apply Newton's method iteratively to find solutions of equations
- Recognise the three potential dangers of Newton's method (divergence, wrong root, horizontal tangent)
Warm up (tech-free)
$y - f(a) = f'(a)\,(x - a)$
$-f(a) = f'(a)(x - a)$
$x - a = -\dfrac{f(a)}{f'(a)}$
The Bisection Method
Consider the solution to $x^3 + 3x + 1 = 0$.
Check endpoints on $[-2, 2]$:
- $f(-2) = -8 - 6 + 1 = -13$ (negative)
- $f(2) = 8 + 6 + 1 = 15$ (positive)
Signs differ ⇒ a root lies somewhere in $(-2, 2)$.
📺 Animation: Bisection method on $f(x)=x^3+3x+1$ over $[-2, 2]$. Watch the orange interval halve at each step — keeping whichever half still contains the sign change — until we converge on $x \approx -0.32$.
| $n$ | $a_n$ | $b_n$ | $m_n$ | $f(m_n)$ | action |
|---|---|---|---|---|---|
| 0 | -2 | 2 | 0 | 1.000 | +ve → keep left half |
| 1 | -2 | 0 | -1 | -3.000 | -ve → keep right half |
| 2 | -1 | 0 | -0.5 | -0.625 | -ve → keep right half |
| 3 | -0.5 | 0 | -0.25 | 0.234 | +ve → keep left half |
| 4 | -0.5 | -0.25 | -0.375 | -0.178 | -ve → keep right half |
| 5 | -0.375 | -0.25 | -0.3125 | 0.0322 | +ve → keep left half |
| 6 | -0.375 | -0.3125 | -0.34375 | -0.0719 | -ve → keep right half |
| 7 | -0.34375 | -0.3125 | -0.328125 | -0.0196 | -ve → keep right half |
| 8 | -0.328125 | -0.3125 | -0.3203125 | 0.0063 | +ve → keep left half |
| 9 | -0.328125 | -0.3203125 | -0.32421875 | -0.0067 | interval width < 0.01 |
=IF(SIGN(f_m)=SIGN(f_a), m, a) to update $a$ and similarly for $b$. Each row halves the interval.The bisection algorithm — summary
- Check $f(a)$ and $f(b)$ have opposite signs.
- Compute the midpoint $m = \dfrac{a + b}{2}$ and $f(m)$.
- If $f(m)$ has the same sign as $f(a)$, the root is in $[m, b]$ — replace $a$ with $m$.
Otherwise the root is in $[a, m]$ — replace $b$ with $m$. - Repeat steps 2–3 until the interval is narrower than the required accuracy.
Newton's Method — a faster iterative approach
From the warm-up (b), starting at $x = x_n$ and following the tangent down to the $x$-axis gives:
Each iteration "snaps" to where the tangent line crosses the $x$-axis, which is usually much closer to the root than $x_n$ itself.
📺 Animation: Newton's method applied to $f(x)=x^2-x-1$ starting at $x_0 = 3$. Watch each tangent (green) snap down to the $x$-axis — the red dots show where the next $x_n$ lands. After three iterations we're already at $\varphi \approx 1.618$ (the golden ratio).
(a) Show that Newton's method gives the iterative formula $\;x_{n+1} = \dfrac{x_n^{\,2} + 1}{2x_n - 1}$.
(b) Start with $x_0 = 3$ and find $x_1$, $x_2$, $x_3$.
$x_{n+1} = x_n - \dfrac{x_n^{\,2} - x_n - 1}{2x_n - 1}$
$x_{n+1} = \dfrac{x_n(2x_n - 1) - (x_n^{\,2} - x_n - 1)}{2x_n - 1}$
$= \dfrac{2x_n^{\,2} - x_n - x_n^{\,2} + x_n + 1}{2x_n - 1} = \dfrac{x_n^{\,2} + 1}{2x_n - 1}$ ✓
| $n$ | $x_n$ | $x_n^{\,2} + 1$ | $2x_n - 1$ | $x_{n+1}$ |
|---|---|---|---|---|
| 0 | 3 | 10 | 5 | $10/5 = 2$ |
| 1 | 2 | 5 | 3 | $5/3 \approx 1.6667$ |
| 2 | $5/3$ | $34/9$ | $7/3$ | $\dfrac{34/9}{7/3} = \dfrac{34}{21} \approx 1.6190$ |
| 3 | $34/21$ | $\approx 1.6180$ | ||
(b) Use Newton's method to solve the equation $x^2 - x - 3 = 0$ numerically. Start with $x_0 = 3$ and find $x_1$ to $x_3$.
$x_{n+1} = x_n - \dfrac{x_n^{\,2} - x_n - 3}{2x_n - 1} = \dfrac{x_n^{\,2} + 3}{2x_n - 1}$
| $n$ | $x_n$ | $x_n^{\,2}+3$ | $2x_n - 1$ | $x_{n+1}$ |
|---|---|---|---|---|
| 0 | 3 | 12 | 5 | $12/5 = 2.4$ |
| 1 | 2.4 | 8.76 | 3.8 | $\approx 2.3053$ |
| 2 | 2.3053 | 8.3142 | 3.6105 | $\approx 2.3028$ |
| 3 | 2.3028 | $\approx 2.3028$ | ||
Three potential dangers when using Newton's method
Newton's method is fast when it works, but a poor choice of $x_0$ can cause it to fail. Here are the three classic dangers.
Convergence to the wrong root
If $f$ has multiple roots, the tangent at $x_0$ might point you toward a different root than you wanted.
📺 Animation: Newton's method on $f(x)=x^3-6x-40$ starting at $x_0 = -1$. The real root is at $x = 4$, but the tangent at $x_0$ shoots us all the way out to $x_1 \approx -12.67$.
Divergence (the iteration runs off to infinity)
If a tangent has a very small or zero gradient near $x_0$, dividing by $f'(x_n)$ can produce huge jumps that move further from the root each time.
📺 Animation: Newton's method on $f(x)=x^3-2x+2$ starting at $x_0 = 0$. Watch as the iteration cycles between $x = 0$ and $x = 1$ over and over, never approaching the actual root near $x \approx -1.77$.
Horizontal tangent — division by zero
If $f'(x_n) = 0$, Newton's formula is undefined: $\dfrac{f(x_n)}{0}$ is impossible. Geometrically, the tangent is horizontal and never crosses the $x$-axis.
📺 Animation: Newton's method on $f(x)=x^2-4$ starting at $x_0 = 0$. The tangent at the vertex is perfectly horizontal — it never crosses the $x$-axis, so the formula produces $-4/0$ and the method can't even take its first step.
Method summary
- Bisection — slow but bulletproof. Use when you need a guaranteed answer and you have a sign change to start with.
- Newton's — fast (quadratic convergence) but fragile. Use when you have a good starting estimate and $f'$ isn't small near the root.
- Pro move: a few bisection steps to narrow the interval, then switch to Newton's for rapid finishing.
Working program — Cambridge textbook
| Exercise | Set work |
|---|---|
| 10H — Bisection & Newton's method | All questions |
Exit ticket — write in your book
- State Newton's iteration formula in terms of $f$ and $f'$.
- Apply one step of Newton's method to $f(x) = x^2 - 5$ starting from $x_0 = 2$. (You should get $x_1 = 9/4$.)
- Name one situation where Newton's method fails.