Notifications

Log in to see your notifications.

Errors is taught in the note for Numerical Methods. Read it below and look for the section on this topic.

Numerical Methods

14 min read

Errors

Numerical answers are approximate. If the exact value is x and the approximation is x̄, the absolute error is |x − x̄| and the relative error is |x − x̄| ÷ |x|. Round-off error arises from using a limited number of digits, and truncation error arises from cutting short a process such as a series.

The secant and Newton–Raphson methods

To solve f(x) = 0 when no formula is available, we start from a guess and improve it. The Newton–Raphson method uses the tangent at the guess:

Newton–Raphson iteration.
The secant method needs no derivative, only two starting values.
Worked exampleSquare root of 2

Use Newton–Raphson on f(x) = x² − 2 with x₀ = 1.5.

  1. The iteration simplifies to xₙ₊₁ = (xₙ + 2/xₙ)/2.
  2. Next.

Answer: The root is 1.4142 after two steps; the value of √2 is 1.41421.

The root is where the graph crosses the x-axis, near 1.414.
Try itNewton–Raphson for √2

Choose a starting guess. Three Newton–Raphson steps are shown.

Numerical integration

When an integral cannot be found by formula, estimate the area under the curve with strips of width h. The trapezoidal rule uses trapeziums and Simpson’s rule uses parabolas (an even number of strips).

Trapezoidal rule and Simpson’s rule.
Worked exampleThe trapezoidal rule

Estimate ∫₀¹ x² dx using 4 strips.

  1. h = 0.25; the y values are 0, 0.0625, 0.25, 0.5625, 1.
  2. Evaluate.

Answer: The estimate is 0.344; the exact value is 0.333. Simpson’s rule gives exactly 0.3333.

Check yourself In Newton–Raphson, the next guess comes from
Check yourself The relative error of 3.14 compared with π ≈ 3.1416 is about
Check yourself Simpson’s rule needs

Key terms

Absolute error
The size of the difference from the exact value.
Iteration
Repeating a step to improve an estimate.
Newton–Raphson
A tangent-based root-finding method.
Trapezoidal rule
Area estimation using trapeziums.

Summary

  • Errors can be absolute or relative.
  • Newton–Raphson: xₙ₊₁ = xₙ − f/f′; the secant method needs no derivative.
  • The trapezoidal rule and Simpson’s rule estimate integrals.
  • Check by a second method or a smaller step.