Numerical methods (DfE content area I) are what you do when algebra runs out. Equations such as $x^3 - x - 4 = 0$, $\mathrm{e}^{-x} = x$ or $\theta = \tfrac{\pi}{2} + \sin\theta$ have no exact solution you can write down, and integrals such as $\displaystyle\int_0^1 \mathrm{e}^{x^2}\,\mathrm{d}x$ cannot be done by any standard technique. But we can find their values to any accuracy we like.
Ans key for iterations and the table mode for sign checks. Put the calculator in radians whenever trigonometric functions appear. Write down enough working (each iterate, each ordinate) for an examiner to follow your method.
| Word | Meaning | Example |
|---|---|---|
| Root | A solution of $\mathrm{f}(x) = 0$; where $y = \mathrm{f}(x)$ meets the $x$-axis. | $\alpha \approx 1.796$ for $x^3 - x - 4 = 0$ |
| Continuous | The graph has no breaks, jumps or asymptotes over the range considered. | Polynomials, $\mathrm{e}^x$; not $\tfrac1x$ near $0$ |
| Change of sign | $\mathrm{f}(a)$ and $\mathrm{f}(b)$ have opposite signs. | $\mathrm{f}(1) = -4$, $\mathrm{f}(2) = 2$ |
| Iteration | Repeatedly applying a formula to its own output. | $x_{n+1} = \sqrt[3]{x_n + 4}$ |
| Fixed point | A value with $\mathrm{g}(\alpha) = \alpha$ โ where $y = \mathrm{g}(x)$ meets $y = x$. | $\alpha = \sqrt[3]{\alpha + 4}$ |
| Converge / diverge | The terms approach a limit / move away without settling. | $|\mathrm{g}'(\alpha)| < 1$ / $> 1$ |
| Staircase / cobweb | Diagrams showing one-sided / alternating iterations. | $\mathrm{g}'(\alpha) > 0$ / $\mathrm{g}'(\alpha) < 0$ |
| Ordinate | A $y$-value used in the trapezium rule. | $n$ strips use $n + 1$ ordinates |
| Upper / lower bound | The limits of values that round to a given answer. | $1.7955$ and $1.7965$ for $1.796$ |
$\mathrm{f}(x) = x^3 + x - 3$. (a) Show that $\mathrm{f}(x) = 0$ has a root $\alpha$ between $1$ and $2$. (b) Use $x_{n+1} = \sqrt[3]{3 - x_n}$ with $x_1 = 1$ to find $x_2$, $x_3$, $x_4$. (c) Use the Newton-Raphson method with $x_0 = 1$ to find $\alpha$ to $3$ d.p. (d) Prove your answer is correct to $3$ d.p.
Each part of DfE content area I, and the page that covers it.
- ILocating RootsChange of sign, narrowing down to a given accuracy, and when the method fails (asymptotes, repeated roots).
- IIteration$x_{n+1} = \mathrm{g}(x_n)$, staircase and cobweb diagrams, and why some rearrangements diverge.
- IThe Newton-Raphson MethodThe formula from the tangent, rapid convergence, and failure near stationary points.
- IThe Trapezium RuleEstimating integrals, over- and underestimates from concavity, and using it in context.
Ans) and round only what you write down.
Sign change
Continuous $\mathrm{f}$, opposite signs $\Rightarrow$ a root between.
Accuracy proof
Sign change across the rounding bounds.
Fails
Asymptotes (false root); repeated or paired roots (no sign change).
Iteration
$x_{n+1} = \mathrm{g}(x_n)$ converges if $|\mathrm{g}'(\alpha)| < 1$.
Diagrams
$\mathrm{g}' > 0$ staircase; $\mathrm{g}' < 0$ cobweb.
Newton-Raphson
$x_{n+1} = x_n - \mathrm{f}(x_n)/\mathrm{f}'(x_n)$
N-R fails
$\mathrm{f}'(x_n) \approx 0$: start away from stationary points.
Trapezium
$\frac h2[\text{ends} + 2 \times \text{middles}]$
Over or under
Convex: over. Concave: under.
Ten questions drawing on the whole Numerical Methods topic. Work each one through before opening the solution.
Show that $x^3 - 4x + 1 = 0$ has a root between $x = 1$ and $x = 2$.
โถ Show solution
Let $\mathrm{f}(x) = x^3 - 4x + 1$. $\mathrm{f}(1) = -2 < 0$ and $\mathrm{f}(2) = 1 > 0$.
Change of sign and $\mathrm{f}$ is continuous, so there is a root between $1$ and $2$.
Show that the equation $\cos x = x$ has a root between $0.7$ and $0.8$.
โถ Show solution
Let $\mathrm{f}(x) = x - \cos x$ (radians).
$\mathrm{f}(0.7) = -0.0648\ldots < 0$ and $\mathrm{f}(0.8) = 0.1033\ldots > 0$.
Change of sign and $\mathrm{f}$ continuous, so there is a root with $0.7 < x < 0.8$.
Use $x_{n+1} = 2 + \dfrac{1}{x_n}$ with $x_1 = 2$ to find $x_2$ to $x_5$. Find the exact limit.
โถ Show solution
$x_2 = 2.5$, $x_3 = 2.4$, $x_4 = 2.41667$, $x_5 = 2.41379$.
The limit satisfies $\alpha = 2 + \dfrac1\alpha$, so $\alpha^2 - 2\alpha - 1 = 0$ and $\alpha = 1 \pm \sqrt2$. The terms are positive, so $\alpha = 1 + \sqrt2 = 2.41421\ldots$
The terms alternate above and below the limit โ a cobweb, since $\mathrm{g}'(x) = -\dfrac{1}{x^2} < 0$.
$x^3 - 4x + 1 = 0$ has roots near $-2.11$, $0.254$ and $1.861$. It is rearranged to $x = \dfrac{x^3 + 1}{4}$. Show that the iteration $x_{n+1} = \dfrac{x_n^3 + 1}{4}$ can converge to the root near $0.254$ but not to the root near $1.861$.
โถ Show solution
$\mathrm{g}'(x) = \dfrac{3x^2}{4}$.
At $0.254$: $\mathrm{g}'(\alpha) \approx 0.048$, between $-1$ and $1$, so it converges (and very quickly: from $x_1 = 0.5$ we get $0.28125,\ 0.25556,\ 0.25417, \ldots$).
At $1.861$: $\mathrm{g}'(\beta) \approx 2.60 > 1$, so it diverges from this root (from $1.9$: $1.9648,\ 2.1461,\ 2.7211, \ldots$).
Use the Newton-Raphson method with $x_0 = 2$ to find the largest root of $x^3 - 4x + 1 = 0$ to $4$ d.p.
โถ Show solution
$\mathrm{f}'(x) = 3x^2 - 4$. $x_1 = 2 - \dfrac{1}{8} = 1.875$.
$x_2 = 1.860979\ldots$, $x_3 = 1.860806\ldots$, $x_4 = 1.860806\ldots$
Root $= 1.8608$ to $4$ d.p.
Explain why $x_0 = \dfrac{2}{\sqrt3}$ is not a suitable starting value for the Newton-Raphson method on $\mathrm{f}(x) = x^3 - 4x + 1$.
โถ Show solution
$\mathrm{f}'\!\left(\tfrac{2}{\sqrt3}\right) = 3 \times \tfrac43 - 4 = 0$. This is a stationary point: the tangent is horizontal and does not meet the $x$-axis, so $x_1$ cannot be found (division by zero).
Use the trapezium rule with $4$ strips to estimate $\displaystyle\int_0^1 2^x\,\mathrm{d}x$ to $4$ d.p.
โถ Show solution
$h = 0.25$; ordinates $1,\ 1.18921,\ 1.41421,\ 1.68179,\ 2$.
$0.125\big[1 + 2 + 2(1.18921 + 1.41421 + 1.68179)\big] = 0.125 \times 11.57042 = 1.4463$.
The exact value of the integral in Question 7 is $\dfrac{1}{\ln 2}$. Explain why the estimate is too large, and find the percentage error.
โถ Show solution
$\dfrac{\mathrm{d}^2}{\mathrm{d}x^2}2^x = (\ln 2)^2\, 2^x > 0$, so the curve is convex and the chords lie above it: an overestimate.
$\dfrac{1}{\ln 2} = 1.44270$. Error $= \dfrac{1.44630 - 1.44270}{1.44270} \times 100 = 0.25\%$.
$\mathrm{f}(x) = \dfrac{3x - 1}{x - 2}$. Show that $\mathrm{f}(1)$ and $\mathrm{f}(3)$ have opposite signs, and explain why $\mathrm{f}(x) = 0$ has no root between $1$ and $3$.
โถ Show solution
$\mathrm{f}(1) = \dfrac{2}{-1} = -2$ and $\mathrm{f}(3) = \dfrac{8}{1} = 8$: opposite signs.
The only root is where the numerator is zero, $x = \tfrac13$, which is not between $1$ and $3$. The sign change is caused by the vertical asymptote $x = 2$: $\mathrm{f}$ is not continuous for $1 \leqslant x \leqslant 3$.
$\mathrm{f}(x) = \ln x + x - 3$.
(a) Show that $\mathrm{f}(x) = 0$ has a root $\alpha$ between $2$ and $3$.
(b) Use $x_{n+1} = 3 - \ln x_n$ with $x_1 = 2$ to find $x_2$, $x_3$ and $x_4$ to $4$ d.p.
(c) Use the Newton-Raphson method with $x_0 = 2$ to find $x_1$ and $x_2$.
(d) Show that $\alpha = 2.208$ to $3$ d.p.
(e) Comment on the two methods.
โถ Show solution
(a) $\mathrm{f}(2) = -0.307 < 0$, $\mathrm{f}(3) = 1.099 > 0$. Change of sign and $\mathrm{f}$ continuous for $x > 0$, so $2 < \alpha < 3$.
(b) $x_2 = 3 - \ln 2 = 2.3069$, $x_3 = 2.1641$, $x_4 = 2.2280$.
(c) $\mathrm{f}'(x) = \dfrac1x + 1$. $x_1 = 2 - \dfrac{-0.30685}{1.5} = 2.20457$, $x_2 = 2.20794$.
(d) $\mathrm{f}(2.2075) = -0.00064 < 0$ and $\mathrm{f}(2.2085) = 0.00081 > 0$. Change of sign, so $2.2075 < \alpha < 2.2085$ and $\alpha = 2.208$ to $3$ d.p.
(e) The iteration oscillates (a cobweb, as $\mathrm{g}'(x) = -\tfrac1x \approx -0.45$ near $\alpha$) and after three steps is only accurate to $1$ d.p. Newton-Raphson is correct to $4$ d.p. after two steps โ much faster, at the cost of needing $\mathrm{f}'(x)$.