Pure mathematics

Numerical Methods

Year 12 · Year 13

  • By the end of this lesson students will be able to locate roots of equations by considering changes of sign.
  • By the end of this lesson students will be able to understand and apply iterative methods to find approximate roots.
  • By the end of this lesson students will be able to understand and apply the Newton-Raphson method to find approximate roots.
  • By the end of this lesson students will be able to use the trapezium rule to estimate the area under a curve.

Key concepts

Locating Roots (Change of Sign Principle)

For a continuous function f(x), if f(a) and f(b) have opposite signs, then there must be at least one root of f(x) = 0 between x = a and x = b. This is because a continuous function must cross the x-axis to change from a positive to a negative value (or vice versa).

Iteration

An iterative method involves rearranging an equation f(x) = 0 into the form x = g(x). Starting with an initial approximation x_0, successive approximations are generated using the iterative formula x_{n+1} = g(x_n). The sequence of values x_0, x_1, x_2, ... may converge to a root of the equation. The convergence depends on the derivative of g(x) near the root; specifically, if |g'(x)| < 1 near the root, the iteration will converge.

x_{n+1} = g(x_n)
Newton-Raphson Method

The Newton-Raphson method is an efficient iterative technique for finding approximations to the roots of a real-valued function. It starts with an initial guess x_0 and uses the tangent line to the curve y = f(x) at x_n to find the next approximation x_{n+1}. The formula is derived from the intersection of the tangent with the x-axis. The method can fail if f'(x_n) is zero or very small near the root, or if the initial guess is far from the root.

x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}
Trapezium Rule

The trapezium rule is a numerical method for approximating the definite integral of a function. It works by dividing the area under the curve into a number of trapeziums of equal width. The sum of the areas of these trapeziums provides an estimate of the total area. The accuracy of the approximation generally increases with the number of strips (trapeziums) used. If the curve is concave, the trapezium rule will overestimate the area; if convex, it will underestimate.

\int_{a}^{b} f(x) \, dx \approx \frac{h}{2} [y_0 + y_n + 2(y_1 + y_2 + \dots + y_{n-1})] \text{, where } h = \frac{b-a}{n}

Key facts to remember

  • 1If f(x) is continuous and f(a) and f(b) have opposite signs, a root lies between a and b.
  • 2The iterative formula is x_{n+1} = g(x_n). Convergence occurs if |g'(x)| < 1 near the root.
  • 3The Newton-Raphson formula is x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}.
  • 4The trapezium rule formula is \int_{a}^{b} f(x) \, dx \approx \frac{h}{2} [y_0 + y_n + 2(y_1 + y_2 + \dots + y_{n-1})].
  • 5The width of each strip for the trapezium rule is h = \frac{b-a}{n}.
  • 6Newton-Raphson can fail if f'(x_n) is close to zero, leading to division by a small number or zero.
  • 7The trapezium rule overestimates for concave curves and underestimates for convex curves.

Worked examples

Example 1

a) Show that the equation x^3 - 3x + 1 = 0 has a root between x = 0 and x = 1. \n b) Use the iterative formula x_{n+1} = \sqrt[3]{3x_n - 1} with x_0 = 0.5 to find the root to 3 decimal places.

Ia) Let f(x) = x^3 - 3x + 1.
IIf(0) = (0)^3 - 3(0) + 1 = 1
IIIf(1) = (1)^3 - 3(1) + 1 = 1 - 3 + 1 = -1
IVSince f(0) > 0 and f(1) < 0, and f(x) is a continuous function, there must be a root between x = 0 and x = 1.
Vb) Using the iterative formula x_{n+1} = \sqrt[3]{3x_n - 1} with x_0 = 0.5:
VIx_0 = 0.5
VIIx_1 = \sqrt[3]{3(0.5) - 1} = \sqrt[3]{1.5 - 1} = \sqrt[3]{0.5} \approx 0.7937005
VIIIx_2 = \sqrt[3]{3(0.7937005) - 1} \approx \sqrt[3]{2.3811015 - 1} = \sqrt[3]{1.3811015} \approx 1.113840
9x_3 = \sqrt[3]{3(1.113840) - 1} \approx \sqrt[3]{3.34152 - 1} = \sqrt[3]{2.34152} \approx 1.32800
10x_4 = \sqrt[3]{3(1.32800) - 1} \approx \sqrt[3]{3.984 - 1} = \sqrt[3]{2.984} \approx 1.4400
11x_5 = \sqrt[3]{3(1.4400) - 1} \approx \sqrt[3]{4.32 - 1} = \sqrt[3]{3.32} \approx 1.4918
12x_6 = \sqrt[3]{3(1.4918) - 1} \approx \sqrt[3]{4.4754 - 1} = \sqrt[3]{3.4754} \approx 1.5146
13x_7 = \sqrt[3]{3(1.5146) - 1} \approx \sqrt[3]{4.5438 - 1} = \sqrt[3]{3.5438} \approx 1.5244
14x_8 = \sqrt[3]{3(1.5244) - 1} \approx \sqrt[3]{4.5732 - 1} = \sqrt[3]{3.5732} \approx 1.5286
15x_9 = \sqrt[3]{3(1.5286) - 1} \approx \sqrt[3]{4.5858 - 1} = \sqrt[3]{3.5858} \approx 1.5303
16x_{10} = \sqrt[3]{3(1.5303) - 1} \approx \sqrt[3]{4.5909 - 1} = \sqrt[3]{3.5909} \approx 1.5310
17x_{11} = \sqrt[3]{3(1.5310) - 1} \approx \sqrt[3]{4.5930 - 1} = \sqrt[3]{3.5930} \approx 1.5313
18x_{12} = \sqrt[3]{3(1.5313) - 1} \approx \sqrt[3]{4.5939 - 1} = \sqrt[3]{3.5939} \approx 1.5314
19x_{13} = \sqrt[3]{3(1.5314) - 1} \approx \sqrt[3]{4.5942 - 1} = \sqrt[3]{3.5942} \approx 1.5315
20x_{14} = \sqrt[3]{3(1.5315) - 1} \approx \sqrt[3]{4.5945 - 1} = \sqrt[3]{3.5945} \approx 1.5315
21The iteration converges to 1.5315... which is 1.532 to 3 decimal places.

Answer

a) f(0) = 1, f(1) = -1. Change of sign implies a root exists. \n b) x \approx 1.532 (3 d.p.)

For iterative methods, it is crucial to show enough iterations to demonstrate convergence to the required accuracy. Keep full calculator accuracy during intermediate steps.

Example 2

Use the Newton-Raphson method to find the positive root of the equation x^3 - 2x - 5 = 0, starting with x_0 = 2. Give your answer to 4 decimal places.

ILet f(x) = x^3 - 2x - 5.
IIFind the derivative: f'(x) = 3x^2 - 2.
IIIThe Newton-Raphson formula is x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}.
IVSubstitute f(x_n) and f'(x_n) into the formula:
Vx_{n+1} = x_n - \frac{x_n^3 - 2x_n - 5}{3x_n^2 - 2}.
VIStarting with x_0 = 2:
VIIx_1 = 2 - \frac{2^3 - 2(2) - 5}{3(2)^2 - 2} = 2 - \frac{8 - 4 - 5}{12 - 2} = 2 - \frac{-1}{10} = 2 + 0.1 = 2.1
VIIIx_2 = 2.1 - \frac{(2.1)^3 - 2(2.1) - 5}{3(2.1)^2 - 2} = 2.1 - \frac{9.261 - 4.2 - 5}{13.23 - 2} = 2.1 - \frac{0.061}{11.23} \approx 2.1 - 0.005431878 \approx 2.094568122
9x_3 = 2.094568122 - \frac{(2.094568122)^3 - 2(2.094568122) - 5}{3(2.094568122)^2 - 2}
10f(x_2) \approx (2.094568122)^3 - 2(2.094568122) - 5 \approx 9.189469 - 4.189136 - 5 \approx 0.000333
11f'(x_2) \approx 3(2.094568122)^2 - 2 \approx 3(4.387208) - 2 \approx 13.161624 - 2 \approx 11.161624
12x_3 \approx 2.094568122 - \frac{0.000333}{11.161624} \approx 2.094568122 - 0.000029834 \approx 2.094538288
13x_4 = 2.094538288 - \frac{(2.094538288)^3 - 2(2.094538288) - 5}{3(2.094538288)^2 - 2}
14f(x_3) \approx (2.094538288)^3 - 2(2.094538288) - 5 \approx 9.189280 - 4.189076 - 5 \approx 0.000004
15f'(x_3) \approx 3(2.094538288)^2 - 2 \approx 11.16145
16x_4 \approx 2.094538288 - \frac{0.000004}{11.16145} \approx 2.094538288 - 0.000000358 \approx 2.09453793
17Comparing x_3 and x_4, they are the same to 4 decimal places (2.0945).
18Therefore, the root to 4 decimal places is 2.0945.

Answer

x \approx 2.0945 (4 d.p.)

Ensure your calculator is in radian mode if trigonometric functions are involved, though not in this example. Carry sufficient decimal places throughout the calculation to avoid premature rounding errors.

Example 3

Use the trapezium rule with 4 strips to estimate the integral \int_{0}^{2} e^{x^2} \, dx. Give your answer to 3 significant figures.

IThe interval is [0, 2] and the number of strips, n = 4.
IICalculate the width of each strip, h = (b-a)/n = (2-0)/4 = 0.5.
IIIDetermine the x-values for the ordinates:
IVx_0 = 0
Vx_1 = 0.5
VIx_2 = 1.0
VIIx_3 = 1.5
VIIIx_4 = 2.0
9Calculate the corresponding y-values (f(x) = e^(x^2)):
10y_0 = e^(0^2) = e^0 = 1
11y_1 = e^(0.5^2) = e^0.25 \approx 1.284025
12y_2 = e^(1.0^2) = e^1 \approx 2.718282
13y_3 = e^(1.5^2) = e^2.25 \approx 9.487736
14y_4 = e^(2.0^2) = e^4 \approx 54.598150
15Apply the trapezium rule formula: \int_{a}^{b} f(x) \, dx \approx \frac{h}{2} [y_0 + y_n + 2(y_1 + y_2 + \dots + y_{n-1})]
16\int_{0}^{2} e^{x^2} \, dx \approx \frac{0.5}{2} [1 + 54.598150 + 2(1.284025 + 2.718282 + 9.487736)]
17\approx 0.25 [55.598150 + 2(13.490043)]
18\approx 0.25 [55.598150 + 26.980086]
19\approx 0.25 [82.578236]
20\approx 20.644559
21Rounding to 3 significant figures, the estimate is 20.6.

Answer

\int_{0}^{2} e^{x^2} \, dx \approx 20.6 (3 s.f.)

Always state the value of 'h' clearly. Be careful with the sum of the y-values: the first and last are added once, while all intermediate y-values are multiplied by 2.

Common mistakes

  • Incorrectly differentiating f(x) when applying the Newton-Raphson method.
  • Rounding intermediate values too early in iterative processes, leading to inaccuracies in the final answer.
  • Miscounting the y-values in the trapezium rule, particularly forgetting to multiply intermediate terms by 2.
  • Using a calculator in the wrong mode (e.g., degrees instead of radians) for trigonometric functions.
  • Choosing an initial value for iteration or Newton-Raphson that is too far from the actual root, leading to divergence or convergence to a different root.

Exam tips

  • Show sufficient working for iterative methods (e.g., x_0, x_1, x_2, ...), especially when asked to show convergence to a certain number of decimal places.
  • Use the 'ANS' button on your calculator to maintain full accuracy during iterative calculations.
  • Clearly state the value of 'h' and list the y-values when using the trapezium rule.
  • Always check the required degree of accuracy (decimal places or significant figures) for your final answer and round only at the very end.

Ready to practise?

Try a problem on this topic

Snap a photo or type a question — get step-by-step working instantly.