Skip to content

Numerical methods

Numerical methods produce controlled approximations when an exact answer is unavailable, unnecessary or too difficult to obtain. At A-level, you use them to:

  • locate and approximate roots of equations;
  • understand when an iterative process converges or fails;
  • approximate a definite integral using the trapezium rule.

An approximation is not a guess. A complete numerical solution identifies the method, shows enough working, controls rounding and justifies the stated accuracy.

You should be able to:

  • evaluate functions and rearrange equations;
  • interpret graphs, roots and intersections;
  • differentiate standard functions;
  • evaluate definite integrals;
  • round to decimal places and significant figures.

Review functions, function graphs, differentiation basics or definite integrals and areas if any of these are uncertain.

The central principle: approximation with evidence

Section titled “The central principle: approximation with evidence”

Suppose the equation

x3+x1=0x^3+x-1=0

has no convenient exact solution. Define

f(x)=x3+x1.f(x)=x^3+x-1.

There are several different questions you might ask.

  1. Does a root exist in a given interval? Use continuity and a change of sign.
  2. What is the root approximately? Use bisection, fixed point iteration or Newton Raphson iteration.
  3. Will the chosen iteration work? Examine the iteration function, its derivative and the starting value.
  4. How accurate is the result? Give a bracket, test rounding boundaries or apply an appropriate stopping criterion.

These questions are related, but they are not interchangeable. A calculator display such as 0.68232780380.6823278038 does not by itself prove that a root exists, that it is unique or that the displayed digits are correct.

If ff is continuous on [a,b][a,b] and

f(a)f(b)<0,f(a)f(b)<0,

then f(a)f(a) and f(b)f(b) have opposite signs. The graph must cross the xx-axis at least once, so there is a root in (a,b)(a,b).

Show that x3+x1=0x^3+x-1=0 has a root between 0.60.6 and 0.70.7.

The function f(x)=x3+x1f(x)=x^3+x-1 is a polynomial, so it is continuous. Also,

f(0.6)=0.63+0.61=0.184f(0.6)=0.6^3+0.6-1=-0.184

and

f(0.7)=0.73+0.71=0.043.f(0.7)=0.7^3+0.7-1=0.043.

Thus

f(0.6)f(0.7)<0.f(0.6)f(0.7)<0.

By continuity, at least one root lies in (0.6,0.7)(0.6,0.7).

Notice the careful conclusion: a sign change proves at least one root, not exactly one. Here,

f(x)=3x2+1>0,f'(x)=3x^2+1>0,

so ff is strictly increasing and the root is unique. Learn how to halve a bracket repeatedly in locating roots using a change of sign.

Rearrange an equation into the form

x=g(x),x=g(x),

choose x0x_0, then generate

xn+1=g(xn).\boxed{x_{n+1}=g(x_n)}.

If xnx_n converges to a limit α\alpha and gg is continuous there, then

α=g(α),\alpha=g(\alpha),

so α\alpha is a fixed point and hence a solution of the rearranged equation.

Use

xn+1=1xn3,x0=0.7,x_{n+1}=\sqrt[3]{1-x_n}, \qquad x_0=0.7,

to find three further approximations to the root of x3+x1=0x^3+x-1=0.

Substitute each value into the formula and retain full calculator precision:

x1=10.73=0.669432,x2=10.6694323=0.691541,x3=10.6915413=0.675771.\begin{aligned} x_1&=\sqrt[3]{1-0.7}=0.669432\ldots,\\ x_2&=\sqrt[3]{1-0.669432\ldots}=0.691541\ldots,\\ x_3&=\sqrt[3]{1-0.691541\ldots}=0.675771\ldots. \end{aligned}

The values alternate around the root. That is expected because g(x)<0g'(x)<0. Near a fixed point α\alpha, errors approximately obey

xn+1αg(α)(xnα).x_{n+1}-\alpha\approx g'(\alpha)(x_n-\alpha).

Thus g(α)<1|g'(\alpha)|<1 usually makes nearby errors shrink, while g(α)>1|g'(\alpha)|>1 usually makes them grow. The rearrangement matters: algebraically equivalent formulae can have completely different numerical behaviour. Study fixed point iteration before when numerical iteration fails.

Newton Raphson uses the tangent to y=f(x)y=f(x) at x=xnx=x_n. The tangent meets the xx-axis at the next approximation:

xn+1=xnf(xn)f(xn).\boxed{x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}}.

It is often much faster than bisection or simple fixed point iteration when the starting value is suitable and f(x)f'(x) is not close to zero.

For f(x)=x3+x1f(x)=x^3+x-1, take x0=0.7x_0=0.7. Since

f(x)=3x2+1,f'(x)=3x^2+1,

the next approximation is

x1=0.70.73+0.713(0.7)2+1=0.70.0432.47=0.682591.\begin{aligned} x_1 &=0.7-\frac{0.7^3+0.7-1}{3(0.7)^2+1}\\ &=0.7-\frac{0.043}{2.47}\\ &=0.682591\ldots. \end{aligned}

A second step gives x2=0.682328x_2=0.682328\ldots, already close to the root. Fast convergence is not a guarantee: a poor starting value, a nearly horizontal tangent or a complicated graph can send the sequence away from the intended root. Continue with the Newton Raphson method.

Do not confuse successive approximations agreeing with a proof of accuracy. A robust way to prove a rounded root is to test its rounding boundaries.

To show that a root is 0.6820.682 correct to three decimal places, test

0.6815and0.6825.0.6815 \quad\text{and}\quad 0.6825.

For f(x)=x3+x1f(x)=x^3+x-1,

f(0.6815)=0.002005,f(0.6825)=0.000416.f(0.6815)=-0.002005\ldots, \qquad f(0.6825)=0.000416\ldots.

The continuous function changes sign between the rounding boundaries, so the unique root lies in (0.6815,0.6825)(0.6815,0.6825) and therefore rounds to

0.682\boxed{0.682}

to three decimal places.

Numerical methods also approximate integrals. Divide [a,b][a,b] into nn equal strips of width

h=ban.h=\frac{b-a}{n}.

If yr=f(a+rh)y_r=f(a+rh), the trapezium rule is

abf(x)dxh2[y0+2(y1+y2++yn1)+yn].\boxed{ \int_a^b f(x)\,dx \approx \frac{h}{2}\left[y_0+2(y_1+y_2+\cdots+y_{n-1})+y_n\right] }.

The end ordinates occur once and every interior ordinate occurs twice.

Use four strips to approximate

02ex2dx.\int_0^2 e^{-x^2}\,dx.

Here a=0a=0, b=2b=2, n=4n=4, so

h=204=0.5.h=\frac{2-0}{4}=0.5.

The ordinates are:

xx000.50.51.01.01.51.52.02.0
ex2e^{-x^2}110.7788010.7788010.3678790.3678790.1053990.1053990.0183160.018316

Therefore

02ex2dx0.52[1+2(0.778801+0.367879+0.105399)+0.018316]=0.8806190.881.\begin{aligned} \int_0^2e^{-x^2}\,dx &\approx \frac{0.5}{2}\left[1+2(0.778801+0.367879+0.105399)+0.018316\right]\\ &=0.880619\ldots\\ &\approx 0.881. \end{aligned}

The exact antiderivative is not an elementary A-level function, but the numerical rule still gives a useful estimate. Smaller strip widths usually improve the approximation. Whether the rule overestimates or underestimates depends on the curve’s concavity. Study the trapezium rule for unequal data presentation, error interpretation and exam technique.

TaskNatural methodMain strengthMain caution
Prove a continuous function has a root in an intervalChange of signReliable existence testDoes not prove uniqueness
Narrow a known sign changing bracketBisectionGuaranteed to retain a bracketConverges relatively slowly
Generate roots from x=g(x)x=g(x)Fixed point iterationSimple and often calculator friendlyChoice of rearrangement controls convergence
Find a root rapidly using ff and ff'Newton RaphsonUsually fast near a simple rootCan fail or approach another root
Approximate a definite integralTrapezium ruleWorks from tabulated valuesIt is an approximation, not exact integration
  • “Opposite signs mean exactly one root.” They prove at least one root, assuming continuity.
  • “No sign change means no root.” A graph can touch the axis and turn around, as f(x)=x2f(x)=x^2 does at x=0x=0.
  • “Every rearrangement converges.” The condition x=g(x)x=g(x) identifies fixed points, but does not ensure iteration reaches one.
  • “Matching decimal displays prove accuracy.” Agreement can be misleading, especially for slowly converging or cyclic sequences.
  • “Newton Raphson always finds the nearest root.” Its tangent steps depend on the shape of the whole graph and the initial value.
  • “The trapezium rule formula uses every ordinate twice.” Only interior ordinates have coefficient 22.
  • “Round at every step.” Keep full precision during calculations and round only the final answer unless instructed otherwise.

A continuous function satisfies f(2)=3f(2)=-3 and f(3)=5f(3)=5. What can you conclude?

Answer

There is at least one root in (2,3)(2,3). You cannot conclude that there is exactly one without further information, such as strict monotonicity.

Given

xn+1=ln(4+xn),x0=1,x_{n+1}=\ln(4+x_n), \qquad x_0=1,

find x1x_1 and x2x_2 to four decimal places.

Answer x1=ln5=1.6094,x_1=\ln 5=1.6094,

then, using the unrounded value,

x2=ln(4+1.609437)=1.7245.x_2=\ln(4+1.609437\ldots)=1.7245.

An iteration has a fixed point α\alpha with g(α)=0.4g'(\alpha)=-0.4. What local behaviour do you expect?

Answer

Since g(α)=0.4<1|g'(\alpha)|=0.4<1, nearby values should converge. The negative sign means successive errors tend to have opposite signs, so the approximations alternate across the fixed point.

Five equally spaced ordinates cover the interval [1,3][1,3]. Find nn and hh, and state the coefficient pattern.

Answer

Five ordinates define four strips, so

n=4,h=314=0.5.n=4, \qquad h=\frac{3-1}{4}=0.5.

The coefficients are

1,2,2,2,1.1,2,2,2,1.
  1. Start with locating roots using a change of sign to understand continuity, brackets and justified rounding.
  2. Learn fixed point iteration and connect algebraic rearrangements with graphical fixed points.
  3. Study the Newton Raphson method for tangent based iteration and rapid root finding.
  4. Consolidate convergence, divergence, cycles and unsuitable starting values in when numerical iteration fails.
  5. Learn the trapezium rule after definite integration, since it approximates area and accumulation rather than solving equations.

For mixed questions, practise choosing a method and checking answers.