HomeLearning HubA Level MathsP2/3 6: Numerical solution of equations
P2/3 6

Numerical solution of equations

Pure Mathematics 2 & 3 · Papers 2 and 3

🎯What you need to be able to do

  • Locate a root approximately by a sign change, and justify the conclusion properly.
  • Show that an equation can be rearranged into a given iterative form.
  • Use an iterative formula \( x_{n+1} = \mathrm{F}(x_n) \) and set the working out clearly.
  • Decide when to stop iterating for a required accuracy.
  • Verify a root to a stated accuracy by a further sign change.
  • Sketch and interpret cobweb and staircase diagrams, and comment on convergence.

📚The mathematics

Locating a root by sign change

If \( \mathrm{f} \) is continuous on \( [a, b] \) and \( \mathrm{f}(a) \) and \( \mathrm{f}(b) \) have opposite signs, then \( \mathrm{f}(x) = 0 \) somewhere between them. The graph must cross the axis to get from one side to the other.

The write-up matters as much as the arithmetic, and a complete answer has three parts:

  1. Evaluate \( \mathrm{f} \) at both ends and state both values, not just their signs.
  2. Observe that there is a change of sign.
  3. State that \( \mathrm{f} \) is continuous on the interval, and conclude there is a root between \(a\) and \(b\).

The continuity condition is not a formality. For \( \mathrm{f}(x) = \dfrac{1}{x} \) the values at \( -1 \) and \( 1 \) have opposite signs, but there is no root — there is an asymptote. If your function has a discontinuity in the interval, the argument fails.

Note also that a sign change proves at least one root, not exactly one; and that a repeated root produces no sign change, so this method can miss roots entirely.

Rearranging into iterative form

Any equation \( \mathrm{f}(x) = 0 \) can be rearranged as \( x = \mathrm{F}(x) \), usually in several ways. A typical question asks you to show that a particular rearrangement is equivalent — work from the original equation towards the given form, showing each algebraic step.

For example, from \( x^{3} - 5x + 1 = 0 \) you might isolate the \(x\) term to get \( x = \dfrac{x^{3}+1}{5} \), or isolate the cube to get \( x = \sqrt[3]{5x - 1} \). Both are valid rearrangements; they do not both converge equally well, which is why the question tells you which one to use.

The iteration itself

\[ x_{n+1} = \mathrm{F}(x_n) \]

Start from the given \( x_0 \), compute \( x_1 \), feed it back in, and repeat. On a calculator, enter the starting value, then type the formula using the answer key and press equals repeatedly — this is far faster and less error-prone than retyping numbers.

Show the intermediate values. A question asking for a root correct to 3 decimal places expects to see the successive iterates listed, usually to more decimal places than the final answer. Writing only the final number risks losing the method marks even when it is right.

Stop when successive iterates agree to the accuracy required. To be confident of 3 decimal places, carry 5 or 6 through the working and continue until two consecutive values round the same way.

Radians, and rounding too early. If the iterative formula contains a trigonometric function, the calculator must be in radian mode — a degree-mode iteration converges to a completely different number, and nothing in the working looks wrong. And rounding each iterate to 3 decimal places before feeding it back in corrupts the sequence; keep full accuracy in the calculator and round only when reporting.

Verifying to a stated accuracy

To confirm a root is \( 1.729 \) correct to 3 decimal places, you must show it lies in the interval that rounds to 1.729 — that is, evaluate \( \mathrm{f}(1.7285) \) and \( \mathrm{f}(1.7295) \) and demonstrate a sign change between them.

Using 1.728 and 1.730 is a common mistake: those are the neighbouring values, not the rounding boundaries. The boundaries are always the half-way points either side.

Cobweb and staircase diagrams

The iteration is drawn by plotting \( y = \mathrm{F}(x) \) and \( y = x \) on the same axes; the root is where they cross. From \( x_0 \) on the \(x\)-axis, go vertically to the curve, then horizontally to the line \( y = x \), and repeat.

  • A staircase diagram — the path climbs or descends in steps on one side of the root — occurs when \( \mathrm{F}'(x) \) is positive near the root.
  • A cobweb diagram — the path spirals in around the root, alternating sides — occurs when \( \mathrm{F}'(x) \) is negative.

The iteration converges when the curve is shallower than the line \( y = x \) near the root, that is when \( \left|\mathrm{F}'(x)\right| < 1 \), and diverges when it is steeper. That is the underlying reason one rearrangement works and another does not, and a question may ask you to comment on it from the diagram.

✏️Worked example

The equation \( x^{3} + 2x - 7 = 0 \) has one real root \( \alpha \). (a) Show that \( \alpha \) lies between 1 and 2. (b) Show that the equation can be rearranged as \( x = \sqrt[3]{7 - 2x} \). (c) Use the iterative formula \( x_{n+1} = \sqrt[3]{7 - 2x_n} \) with \( x_0 = 1.5 \) to find \( \alpha \) correct to 3 decimal places, showing your iterates. (d) Verify that your answer is correct to 3 decimal places.

(a) Let \( \mathrm{f}(x) = x^{3} + 2x - 7 \).

\( \mathrm{f}(1) = 1 + 2 - 7 = -4 \)
\( \mathrm{f}(2) = 8 + 4 - 7 = 5 \)

There is a change of sign, and \( \mathrm{f} \) is a polynomial and therefore continuous on \( [1, 2] \). Hence there is a root between 1 and 2.

(b) From \( x^{3} + 2x - 7 = 0 \) we get \( x^{3} = 7 - 2x \), and taking the cube root of both sides gives \( x = \sqrt[3]{7 - 2x} \), as required.

(c) Starting from \( x_0 = 1.5 \):

\( x_1 = \sqrt[3]{4} = 1.58740 \)
\( x_2 = \sqrt[3]{3.82520} = 1.56393 \)
\( x_3 = \sqrt[3]{3.87216} = 1.57030 \)
\( x_4 = \sqrt[3]{3.85940} = 1.56858 \)
\( x_5 = \sqrt[3]{3.86286} = 1.56905 \)
\( x_6 = \sqrt[3]{3.86192} = 1.56892 \)

The iterates are settling around 1.5689, so \( \alpha = 1.569 \) to 3 decimal places. Notice the values alternate above and below the limit — this iteration produces a cobweb, so \( \mathrm{F}'(\alpha) \) is negative.

(d) To verify 3 decimal places, test the rounding boundaries 1.5685 and 1.5695:

\( \mathrm{f}(1.5685) = -0.0042 \)
\( \mathrm{f}(1.5695) = +0.0052 \)

The sign changes between them, and \( \mathrm{f} \) is continuous, so the root lies in \( (1.5685,\ 1.5695) \) and therefore rounds to 1.569 to 3 decimal places.

Check it. Substitute directly: \( 1.569^{3} + 2(1.569) - 7 = 3.8625 + 3.138 - 7 = 0.0005 \), which is close to zero as it should be. A residual of this size is consistent with a root accurate to about 3 or 4 decimal places.
The verification uses the rounding boundaries, not neighbouring values. Testing \( \mathrm{f}(1.568) \) and \( \mathrm{f}(1.570) \) shows only that the root is somewhere in a wider interval — which does not establish that it rounds to 1.569. The boundaries are always the value \( \pm 0.0005 \) for 3 decimal places. Getting this step exactly right is worth two marks and is the part candidates most often fumble.

📝Practise

Work through these, then reveal the answer. Each question targets a different objective from the list above.

1. Show that \( \mathrm{f}(x) = x^{3} - 4x + 1 \) has a root between 1 and 2.
\( \mathrm{f}(1) = 1 - 4 + 1 = -2 \) and \( \mathrm{f}(2) = 8 - 8 + 1 = 1 \). There is a change of sign, and \( \mathrm{f} \) is a polynomial and hence continuous on \( [1,2] \), so there is a root between 1 and 2. Stating the two values and the continuity is what earns the marks — "the signs are different" alone is incomplete.
2. Show that \( \mathrm{e}^{x} = 3x \) can be rearranged as \( x = \ln(3x) \), and state a restriction on \(x\).
Taking natural logarithms of both sides of \( \mathrm{e}^{x} = 3x \) gives \( x = \ln(3x) \). The restriction is \( x > 0 \), since \( \ln \) requires a positive argument — and indeed \( \mathrm{e}^{x} \) is always positive, so \( 3x \) must be too.
3. Use \( x_{n+1} = \dfrac{x_n^{3} + 1}{4} \) with \( x_0 = 0.25 \) to find a root of \( x^{3} - 4x + 1 = 0 \) to 3 decimal places.
\( x_1 = \dfrac{0.015625 + 1}{4} = 0.253906 \); \( x_2 = \dfrac{0.016368 + 1}{4} = 0.254092 \); \( x_3 = \dfrac{0.016404 + 1}{4} = 0.254101 \); \( x_4 = 0.254101 \). The values have settled, so the root is \( 0.254 \) to 3 d.p. This iteration is a staircase — the iterates approach from one side only, which tells you \( \mathrm{F}'(x) > 0 \) near the root.
4. A root of \( \mathrm{f}(x) = 0 \) is believed to be 2.43 correct to 2 decimal places. State exactly which two values of \( \mathrm{f} \) you would evaluate to verify this.
\( \mathrm{f}(2.425) \) and \( \mathrm{f}(2.435) \) — the boundaries of the interval that rounds to 2.43 to 2 decimal places. If they have opposite signs and \( \mathrm{f} \) is continuous, the root lies between them and therefore rounds to 2.43. Using 2.42 and 2.44 would prove something weaker and does not answer the question.
5. Explain why the iteration \( x_{n+1} = \dfrac{5}{x_n - 1} \) starting at \( x_0 = 3 \) fails to converge to the nearby root.
Compute a few iterates: \( x_1 = \dfrac{5}{2} = 2.5 \), \( x_2 = \dfrac{5}{1.5} = 3.333 \), \( x_3 = \dfrac{5}{2.333} = 2.143 \), \( x_4 = \dfrac{5}{1.143} = 4.375 \). The values are moving further apart rather than settling. The reason is that \( \left|\mathrm{F}'(x)\right| > 1 \) near the root: the curve \( y = \mathrm{F}(x) \) is steeper than the line \( y = x \) there, so each step is magnified rather than damped, and the cobweb spirals outwards. A different rearrangement is needed.
6. On a sketch of \( y = \mathrm{F}(x) \) and \( y = x \), the iteration path spirals inwards around the intersection. State whether this is a cobweb or a staircase, and what it tells you about \( \mathrm{F}'(x) \).
Spiralling inwards, alternating from side to side, is a cobweb diagram. It indicates \( \mathrm{F}'(x) < 0 \) near the root — the curve slopes downwards there, so each step overshoots to the other side. Since the spiral moves inwards rather than outwards, \( \left|\mathrm{F}'(x)\right| < 1 \) and the iteration converges. A staircase, by contrast, approaches from one side only and corresponds to \( \mathrm{F}'(x) > 0 \).

🔗Go deeper — other people’s work

These are external resources, not mine. If one stops working, tell me and everything above it on this page still stands.

  • Desmos — plot \( y = \mathrm{F}(x) \) and \( y = x \) and step through an iteration by hand to draw the cobweb
  • GeoGebra — interactive fixed-point iteration applets
  • Khan Academy — the intermediate value theorem, which is what the sign-change argument rests on