Lesson 10: Numerical Methods
🎧 Audio narration for this lesson is coming soon.
Not every equation can be solved exactly — x⁵ − x − 1 = 0 has no formula-based solution, yet engineers need its root. Numerical methods are the A-level answer: systematic approximations with guaranteed error bounds, the same algorithms computers use. This lesson covers locating roots by sign changes, the iterative x = g(x) method with staircase/cobweb diagrams, the Newton–Raphson method with its convergence conditions, and error analysis. Numerical methods also answer 'how accurate?' — rigour about approximation.
Locating roots — sign changes and bounds
A root of f(x) = 0 in [a, b] is guaranteed if f is continuous and f(a), f(b) have opposite signs (intermediate value theorem) — and if f is strictly monotonic there, the root is unique. Example: f(x) = x³ − 2x − 5 (the classic Wallis equation). f(2) = −1, f(3) = 16: opposite signs → root in (2, 3). f'(x) = 3x² − 2 > 0 for x > 1, so f is increasing on (2, 3) → exactly one root. Two sentences, total rigour.
Refining by bisection: evaluate at the midpoint, keep the half with the sign change. f(2.5) = 5.625 > 0 → root in (2, 2.5). f(2.25) ≈ 1.89 > 0 → (2, 2.25). f(2.125) ≈ 0.35 > 0 → (2, 2.125). f(2.0625) ≈ −0.35 < 0 → (2.0625, 2.125). Five evaluations trap the root in an interval of width 1/16 — slow but utterly reliable.
Decimal search generalises: evaluate f at 2.0, 2.1, 2.2, ... to find the sign-change interval, then refine to 2.06, 2.07, .... Examiners ask for roots 'to 2 decimal places' — meaning find consecutive 2-d.p. values with a sign change, then test the midpoint to decide the rounding: f(2.09) < 0 and f(2.10) > 0 puts the root in (2.09, 2.10), and f(2.095) > 0 narrows it to (2.09, 2.095), so the root is 2.09 to 2 d.p.
Worked example (bracketing with bounds). Show that x⁵ − x − 1 = 0 has a root between 1.1 and 1.2, and state an error bound. f(x) = x⁵ − x − 1: f(1.1) = 1.61051 − 2.1 ≈ −0.489 < 0; f(1.2) = 2.48832 − 2.2 ≈ 0.288 > 0. f is continuous (a polynomial), so a root lies in (1.1, 1.2), and the midpoint estimate 1.15 has error at most 0.05. (The true root is ≈ 1.167.) Bracketing first — every later method starts from a bracket.
Fixed-point iteration — x = g(x)
Rearrange f(x) = 0 as x = g(x), then iterate xₙ₊₁ = g(xₙ). Fixed points of g are roots of f. Example: x³ − 2x − 5 = 0 → x = ∛(2x + 5): start x₁ = 2: x₂ = ∛9 ≈ 2.0801, x₃ = ∛(9.1602) ≈ 2.0924, x₄ ≈ 2.0942, ... converging to ≈ 2.0946. The staircase diagram (plot y = g(x) and y = x; the iteration bounces between curve and line) shows convergence visually — examiners ask you to draw it.
But not all rearrangements converge: x = (x³ − 5)/2 gives x₂ = 1.5, x₃ = −0.8125, x₄ = −2.73, ... diverging wildly. The condition: iteration converges (locally) if |g'(x)| < 1 near the root, and diverges if |g'(x)| > 1. Check |g'| before iterating — a favourite 'explain why this iteration fails' question: for g(x) = (x³ − 5)/2, g'(x) = 3x²/2 ≈ 6.6 near x = 2 — far above 1, so each step multiplies the error by about 6.6.
Rate of convergence: smaller |g'| means faster convergence (error multiplies by ≈ |g'| each step). Newton–Raphson (next section) is just fixed-point iteration with g(x) = x − f(x)/f'(x), engineered so g'(root) = 0 — giving quadratic convergence. Choosing rearrangements: aim for g with small derivative near the root; cube roots and fractions (dividing by large numbers) usually contract, while cubing or multiplying usually expand.
Newton–Raphson — the tangent method
Newton–Raphson linearises: from xₙ, follow the tangent to the x-axis: xₙ₊₁ = xₙ − f(xₙ)/f'(xₙ). Geometrically obvious, computationally powerful. Example: f(x) = x³ − 2x − 5, f'(x) = 3x² − 2, start x₁ = 2: x₂ = 2 − (−1)/10 = 2.1; x₃ = 2.1 − (0.061)/11.23 ≈ 2.09457; x₄ ≈ 2.0945515 — five correct decimal places in three steps. Quadratic convergence: correct digits roughly double each iteration (once close).
Convergence needs: f'(xₙ) ≠ 0 (no flat tangents), a starting point near the root, and no oscillation. Failure modes examiners love: starting at a stationary point gives division by zero; f(x) = ∛x from x₁ = 1 oscillates (tangent overshoots across the root repeatedly); f with a discontinuity between start and root converges to the wrong root or diverges. Always sketch first: the sketch suggests a good starting value and warns of nearby stationary points.
Worked exam-style: use Newton–Raphson with x₁ = 1.5 to find the root of x³ + x − 7 = 0 to 4 decimal places. f(1.5) = −2.125, f'(1.5) = 7.75 → x₂ = 1.5 + 2.125/7.75 ≈ 1.77419. f(x₂) ≈ 0.3589, f'(x₂) ≈ 10.443 → x₃ ≈ 1.73982. f(x₃) ≈ 0.00625 → x₄ ≈ 1.73920. f(x₄) ≈ 0 to within 10⁻⁶ → root 1.7392 to 4 d.p. Show each iteration's values — method marks for the formula applied correctly even with arithmetic slips.
Errors, bounds, and choosing methods
Every numerical answer needs an error bound. Bisection after n steps: error ≤ (b − a)/2ⁿ. Sign-change pairs: if f(2.09) < 0 < f(2.10), the root is in (2.09, 2.10) and any value in between has error < 0.01. Fixed-point iteration: once successive iterates agree to k decimal places and a sign change confirms the bracket, the root is certified.
Method comparison: bisection — slow (linear), bulletproof; fixed-point — medium, needs |g'| < 1; Newton–Raphson — fastest (quadratic), but needs f' and a good start, and fails at stationary points or discontinuities. Choose by the problem: 'guaranteed' → bisection; 'efficient' → Newton–Raphson; 'given this rearrangement' → check |g'| and iterate.
In context: a bridge cable's shape satisfies a transcendental equation solvable only numerically; a £50,000 loan's true APR is the root of a polynomial of degree 360 (monthly payments over 30 years) — found by Newton–Raphson in milliseconds. Numerical methods are not second-best to exact solutions; for most real equations they are the only solutions. The A-level rigour — bracketing, conditions, bounds — is what makes them trustworthy.
Integration connection and exam technique
The trapezium rule (Lesson 6) is numerical integration; root-finding is its algebraic sibling — both replace the impossible with the approximate-but-bounded. Some exam questions blend them: 'use the trapezium rule to estimate ∫, then use iteration to solve...' Treat each part independently and check conditions separately.
Exam technique: (1) for 'show a root exists in (a, b)': compute f(a), f(b), cite continuity and sign change — three elements, all needed; (2) for iteration questions, state the rearrangement, show 3–4 iterations to the required accuracy, and prove the accuracy with a sign-change check or error bound; (3) for Newton–Raphson, write the formula with f and f' identified before substituting numbers; (4) for 'draw the staircase diagram', plot y = x and y = g(x) accurately near the root — the diagram must show the cobweb converging; (5) never round intermediate iterations — carry full precision, round only the final answer.
Euler's method — numerical differential equations
When dy/dx = f(x, y) cannot be solved exactly, Euler's method steps along the gradient: from (xₙ, yₙ), take yₙ₊₁ = yₙ + h·f(xₙ, yₙ), xₙ₊₁ = xₙ + h. It is the tangent-line approximation applied repeatedly — first principles made iterative. Example: dy/dx = x + y, y(0) = 1, estimate y(0.5) with h = 0.25. Step 1: f(0, 1) = 1, y₁ = 1 + 0.25(1) = 1.25 at x = 0.25. Step 2: f(0.25, 1.25) = 1.5, y₂ = 1.25 + 0.375 = 1.625 at x = 0.5. So y(0.5) ≈ 1.625 (exact: 2e^{0.5} − 1.5 ≈ 1.797 — Euler underestimates for convex solutions).
Error analysis: local error per step is O(h²) (the Taylor remainder), so global error over a fixed interval is O(h) — halving h halves the error. The improved Euler (Heun) method averages the gradients at the start and predicted end of each step, achieving O(h²) globally — much better for slightly more work. Runge–Kutta (RK4, O(h⁴)) is the professional standard; spreadsheets and solvers use it silently.
Worked exam-style: dy/dx = y − x², y(0) = 2, use Euler with h = 0.2 to estimate y(0.4). Step 1: f(0, 2) = 2, y₁ = 2.4 at 0.2. Step 2: f(0.2, 2.4) = 2.36, y₂ = 2.4 + 0.472 = 2.872 at 0.4. Answer ≈ 2.87. Tabulate x, y, f(x, y) in columns — examiners award method marks for the table even when arithmetic slips. Euler's method is numerical analysis meeting differential equations: the course's threads weaving together.
Common mistakes
- Claiming a root without continuity. A sign change proves a root only for continuous f. For f(x) = 1/x, f(−1) and f(1) have opposite signs but there is no root — there is a discontinuity. State continuity explicitly.
- Rounding iterates early. Rounding x₂ to 2 d.p. before computing x₃ compounds errors and can 'prove' the wrong final digit. Full precision throughout; round once, at the end.
- Declaring accuracy without proof. Agreement of successive iterates suggests convergence; the certificate is a sign change (or error bound) around your value. Examiners want f(2.09) < 0 < f(2.095), not 'the iterates stopped changing'.
- Newton–Raphson from a stationary point. If f'(x₁) ≈ 0 the step explodes or divides by zero. Sketch first and start away from turning points.
- Iterating a divergent rearrangement. Check |g'(x)| < 1 near the root before trusting iterates; if |g'| > 1, choose a different rearrangement rather than reporting runaway values.
Exam Experience
Questions in the style of the A-level pure paper. Attempt them before reading the mark scheme.
1. Let f(x) = x³ − 2x − 5. (a) Show that f(x) = 0 has a root in the interval (2, 3). [2] (b) Use one application of the Newton–Raphson method, starting with x₁ = 2, to find a better approximation to the root. [2] (c) Given that f(2.09) < 0 and f(2.095) > 0, explain why the root is 2.09 to two decimal places. [2]
Mark scheme.
- 1(a) f(2) = 8 − 4 − 5 = −1 and f(3) = 27 − 6 − 5 = 16 (M1) for both evaluations. Opposite signs and f is continuous (polynomial), so a root lies in (2, 3) (A1) — all three elements (two values, sign change, continuity) are required.
- 1(b) f'(x) = 3x² − 2, so f'(2) = 10 (M1). x₂ = 2 − (−1)/10 = 2.1 (A1).
- 1(c) The sign change puts the root in (2.09, 2.095) (M1). Every number in this interval rounds to 2.09 at two decimal places, so the root is 2.09 to 2 d.p. (A1) — the proof of accuracy is the narrowed bracket, not the iteration itself.
📈 Interactive Graph: Function Explorer — Numerical Methods
Explore how functions behave — a core skill for Numerical Methods.
🎛️ Interactive Explorer: Quadratic Explorer — Numerical Methods
Drag the sliders to change the coefficients of y = ax² + bx + c and watch the parabola transform live.
Notice how a controls the width and direction, b shifts the axis of symmetry, and c moves the graph up and down.
Key Terms
- Intermediate value theorem
- A continuous f with f(a), f(b) of opposite signs has a root in (a, b).
- Bisection
- Halving a bracketing interval repeatedly; error ≤ (b-a)/2ⁿ after n steps.
- Fixed-point iteration
- xₙ₊₁ = g(xₙ) from rearranged f(x) = 0 as x = g(x).
- Contraction condition
- Convergence guaranteed (locally) if |g'(x)| < 1 near the root.
- Staircase/cobweb diagram
- Plotting y = g(x) with y = x to visualise iteration converging or diverging.
- Newton-Raphson
- xₙ₊₁ = xₙ - f(xₙ)/f'(xₙ): tangent-based, quadratically convergent.
- Quadratic convergence
- Correct digits roughly doubling per iteration (near the root).
- Sign-change pair
- Consecutive values bracketing a root, proving a decimal-place answer.
- Transcendental equation
- An equation mixing algebraic and transcendental functions — generally unsolvable exactly.
- Error bound
- A guaranteed limit on approximation error, e.g. ±0.005 for 2 d.p. via bracketing.
Discussion Questions
- Show that f(x) = x³ - 4x + 1 has three distinct roots, locating each in an interval of width 1. Then use bisection twice on one interval and state the resulting bound.
- The equation x³ - 2x - 5 = 0 rearranges as x = (2x + 5)/x². (a) Compute g'(x) and show |g'| < 1 near the root ≈ 2.09. (b) Perform 4 iterations from x₁ = 2 and prove your answer to 2 decimal places.
- Use Newton-Raphson starting at x₁ = 2 to solve eˣ = 4x (find the smaller root) to 4 decimal places. Sketch to justify your starting value and explain why the method might fail from x₁ = 0.
- A circle of radius 5 cm has a chord dividing it so the smaller segment has area 20 cm². The segment area is (25/2)(θ - sinθ) for angle θ. Set up the equation, show a root exists in (1, 2), and find θ to 3 significant figures by iteration.
- Critique this: 'xₙ₊₁ = xₙ² - 2 converges to the root of x² - x - 2 = 0 near x = 2.' Compute g'(2), describe what actually happens from x₁ = 2.1, and propose a better rearrangement.