Numerical methods in context

Numerical methods in context

Spec I4 · AQA A-Level Maths: Revision notes

Studying this course? Keep your progress in one place.

Key facts

  • Use a numerical method when no exact algebraic solution exists.
  • Bisection is reliable but slow; Newton-Raphson is fast but needs f′f'; iteration needs ∣g′(α)∣<1|g'(\alpha)|<1.
  • Form the equation from the context, then write it as f(x)=0f(x)=0.
  • To show a root to nn d.p., show a change of sign between the rounding boundaries.
  • Evaluate a method with numbers: quote g′(α)g'(\alpha) and link it to the behaviour.

Why numerical methods

When variables mix with their exponentials or logarithms, or an integral has no simple antiderivative.

Many problems cannot be solved analytically, by exact algebra. Equations such as ex=3xe^x=3x and d+ln⁡d=4d+\ln d=4 mix a variable with its exponential or logarithm, and integrals such as ∫e−x2 dx\int e^{-x^2}\,dx have no simple antiderivative.

Numerical methods give a solution to a required accuracy instead of an exact one. If an equation can be rearranged exactly (such as ln⁡x=2\ln x=2 giving x=e2x=e^2), do that.

−1−0.50.511.522.532468xyx ≈ 0.619x ≈ 1.512y = eˣy = 3x
ex=3xe^x=3x cannot be solved by algebra, but the graphs show two roots.

Which of these needs a numerical method?

Choosing a method

Match the method to the task: sign change for a root interval, Newton-Raphson for speed, trapezium rule for areas.

Interval bisection is reliable but slow. Fixed-point iteration xn+1=g(xn)x_{n+1}=g(x_n) needs a rearrangement with ∣g′(α)∣<1|g'(\alpha)|<1. Newton-Raphson is usually fastest but needs f′f' and fails if f′(xn)=0f'(x_n)=0. For areas and integrals use the trapezium rule with enough strips.

11.21.41.61.822.22.4−2246810xy(2, 4)y = x³ − x − 2tangent at x = 2
Newton-Raphson on f(x) = x³ − x − 2 from x₀ = 2: the tangent meets the x-axis at 1.636, closer to the root (about 1.521).

Bisection

Needs:
ff continuous and a sign change
Weakness:
Slow

Iteration

Needs:
A rearrangement x=g(x)x=g(x)
Weakness:
Diverges if ∣g′(α)∣>1|g'(\alpha)|>1

Newton-Raphson

Needs:
f′(x)f'(x)
Weakness:
Fails if f′(xn)=0f'(x_n)=0

Trapezium rule

Needs:
Equally spaced yy-values
Weakness:
Accuracy depends on the strips

Worked example

Solve θ−0.5sin⁡θ=1\theta-0.5\sin\theta=1 (radians) using Newton-Raphson with θ0=1.5\theta_0=1.5.

Which method needs the derivative of ff?

Setting up a problem

Form the equation, write it as f(x)=0f(x)=0 with defined units, and locate the root.

First form the equation from the context, then rewrite it as f(x)=0f(x)=0, with units. For d+ln⁡d=4d+\ln d=4, f(d)=d+ln⁡d−4f(d)=d+\ln d-4, f(2.9)=−0.0353f(2.9)=-0.0353 and f(3)=0.0986f(3)=0.0986, so 2.9<d<32.9<d<3.

The iteration dn+1=4−ln⁡dnd_{n+1}=4-\ln d_n with d0=3d_0=3 gives d1=2.901d_1=2.901 and d2=2.935d_2=2.935, which settle on the root. Use the ANS key. Always check that the answer makes sense: depths and widths must be positive, and the units stated.

2.62.72.82.933.13.22.62.72.82.933.13.2xy(d₀, d₁)rooty = 4 − ln xy = x
Cobweb for dn+1=4−ln⁡dnd_{n+1}=4-\ln d_n: g′≈−0.34g'\approx-0.34 at the root, so it converges.

Worked example

Show that d+ln⁡d=4d+\ln d=4 has a root between 2.92.9 and 33.

f(2.9)=−0.0353f(2.9)=-0.0353 and f(3)=0.0986f(3)=0.0986. What does this show?

Required accuracy

Show a change of sign between the rounding boundaries, such as 2.4552.455 and 2.4652.465 for 2.462.46.

Stopping when successive iterates agree to the required number of decimal places is not a proof. To show a root is 2.462.46 to 22 d.p., show a change of sign over [2.455,2.465][2.455,2.465].

For integrals, compare estimates with different numbers of strips, or compute the percentage error when an exact value is known: for ∫01e−x2 dx\int_0^1e^{-x^2}\,dx, 44 strips give 0.7430.743 against 0.74680.7468, an error of 0.51%0.51\%.

2.42.422.442.462.482.52.52−0.2−0.10.10.2xy(2.455, −0.0237)(2.465, 0.1179)y = x³ − 4x − 5
f(x) = x³ − 4x − 5 changes sign between 2.455 and 2.465, so the root is 2.46 to 2 d.p.

Worked example

Show that the root of f(x)=x3−4x−5f(x)=x^3-4x-5 is 2.462.46 to 22 d.p.

To show a root is 1.351.35 to 22 d.p., you should find the sign of ff at…

Evaluating a method

Give a value and a reason: for example, diverges because g′(α)≈4.5>1g'(\alpha)\approx4.5>1.

Be ready to say why a method fails or is poor. A rearrangement fails if ∣g′(α)∣>1|g'(\alpha)|>1. For x3−4x−5=0x^3-4x-5=0, xn+1=xn3−54x_{n+1}=\frac{x_n^3-5}{4} has g′(x)=3x24≈4.5g'(x)=\frac{3x^2}{4}\approx4.5 at the root. From x0=2.5x_0=2.5 it gives 2.6562.656, 3.4353.435, diverging; the rearrangement xn+1=4xn+53x_{n+1}=\sqrt[3]{4x_n+5} converges.

Quote the numbers and link them to the behaviour. State limits too: bisection is slow, Newton-Raphson can fail near stationary points, and the trapezium rule is only as accurate as the strips allow.

  1. 1

    Find g′(α)

    differentiate the rearrangement and evaluate at the root

  2. 2

    Compare with 1

    is |g′(α)| less than 1, or more?

  3. 3

    State the behaviour

    converges (staircase or cobweb) or diverges

  4. 4

    Quote values

    give the numbers from the iteration as evidence

Evaluating an iteration

A rearrangement has g′(α)=−0.4g'(\alpha)=-0.4. What do you say about the iteration?

Try an exam question

A student uses xn+1=xn3−54x_{n+1}=\frac{x_n^3-5}{4} to find the root of x3−4x−5=0x^3-4x-5=0 near 2.462.46. Show that this iteration will not converge, and find x1x_1 using xn+1=4xn+53x_{n+1}=\sqrt[3]{4x_n+5} with x0=2.5x_0=2.5.

[4 marks]

That's the notes covered.

Carry on to the next subtopic.

Try a question

Why is a numerical method needed to solve this equation?

1 mark, marked against the mark scheme

Revision notes