UcenlyOpen in the app

Differential Equations & Numerical Methods · BE5B01DEN · Topic 3 of 13

Approximating the derivative, order of a method

Week 3. Forward and central differences have different orders; the order tells you how the error shrinks with h.

Open the interactive lesson

Key ideas

Three difference quotients

The forward, backward and central differences approximate f′(a) from values of f near a.

Orders and the second derivative

The one-sided quotients have error O(h); the central quotient and the second-difference formula have error O(h²). The central formula is more accurate for smooth f at the same step.

Predict errors with the order

If E(h)≈C·h^p then halving h divides the error by 2^p. Big-O calculus: O(h^a)·O(h^b)=O(hᵃ⁺ᵇ), and a sum of O terms keeps the lower power.

In one line: The order p is the exponent in E≈C·h^p; use it to predict, not just to name, the error.

Formulas

Practice with worked solutions

Question 1

Approximate f′(2) for f(x) = x³ by the forward difference with h = 0.1.

f(a+h)−f(a)h\frac{f(a+h)-f(a)}h
Worked solution

Answer: 12.61

  1. 2.13−230.1=9.261−80.1=12.61\frac{2.1^3-2^3}{0.1}=\frac{9.261-8}{0.1}=12.61
  2. true value f′(2)=12, error 0.61\text{true value }f'(2)=12,\ \text{error }0.61

Evaluate (2.1³ − 2³)/0.1.

Question 2

Approximate f′(2) for f(x) = x³ by the central difference with h = 0.1.

f(a+h)−f(a−h)2h\frac{f(a+h)-f(a-h)}{2h}
Worked solution

Answer: 12.01

  1. 9.261−6.8590.2=2.4020.2=12.01\frac{9.261-6.859}{0.2}=\frac{2.402}{0.2}=12.01
  2. error 0.01=h2⋅f′′′(a)/6\text{error }0.01=h^2\cdot f'''(a)/6

Evaluate (2.1³ − 1.9³)/0.2; the error is much smaller than for the forward difference.

Question 3

Approximate f″(1) for f(x) = x⁴ using the second difference with h = 1/2.

f′′(a)≈f(a+h)+f(a−h)−2f(a)h2f''(a)\approx\frac{f(a+h)+f(a-h)-2f(a)}{h^2}
Worked solution

Answer: 25/2

  1. f(1.5)=5.0625, f(0.5)=0.0625, f(1)=1f(1.5)=5.0625,\ f(0.5)=0.0625,\ f(1)=1
  2. 5.0625+0.0625−20.25=12.5\frac{5.0625+0.0625-2}{0.25}=12.5

Use f(1.5), f(0.5) and f(1) in the second difference.

More Differential Equations & Numerical Methods practice in Ucenly

Sources

Written by Ucenly. Based on the BE5B01DEN course materials: