BIT203 · 2082 · 5 marks
Find the first and second derivative at x = 2.5 of the following data points.
Find the first and second derivative at $x = 2.5$ of the following data points.
$$\begin{array}{|c|cccccc|}\hline x & 1.5 & 2 & 2.5 & 3 & 3.5 & 4 \ \hline f(x) & 2.375 & 4.5 & 7.625 & 12 & 17.875 & 23 \ \hline \end{array}$$
[5]
Numerical Differentiation at x = 2.5
Given
| $x$ | 1.5 | 2.0 | 2.5 | 3.0 | 3.5 | 4.0 |
|---|---|---|---|---|---|---|
| $f(x)$ | 2.375 | 4.5 | 7.625 | 12 | 17.875 | 23 |
- Step size: $h = 0.5$
- Point of interest: $x = 2.5$
Solution
Forward Difference Table
Take $x_0 = 2.5$ so that $p = 0$. First compute all differences carefully.
| $x$ | $f$ | $\Delta f$ | $\Delta^2 f$ | $\Delta^3 f$ | $\Delta^4 f$ | $\Delta^5 f$ |
|---|---|---|---|---|---|---|
| 1.5 | 2.375 | 2.125 | 1.0 | 0.25 | 0 | -2.5 |
| 2.0 | 4.5 | 3.125 | 1.25 | 0.25 | -2.5 | |
| 2.5 | 7.625 | 4.375 | 1.5 | -2.25 | ||
| 3.0 | 12.0 | 5.875 | -0.75 | |||
| 3.5 | 17.875 | 5.125 | ||||
| 4.0 | 23.0 |
Checks:
- $\Delta f$: $2.125, 3.125, 4.375, 5.875, 5.125$
- $\Delta^2 f$: $1.0, 1.25, 1.5, -0.75$
- $\Delta^3 f$: $0.25, 0.25, -2.25$
- $\Delta^4 f$: $0, -2.5$
- $\Delta^5 f$: $-2.5$
Note: the data comes from $f(x)=x^3+\tfrac{1}{2}x^2-1$ up to $x=3.5$ but the last point $f(4)=23$ breaks the cubic (true cubic value would be $71$). This is why higher differences do not vanish. We proceed with the tabulated data as given.
At $x_0 = 2.5$ (the row starting there): $$\Delta f_0 = 4.375,\ \Delta^2 f_0 = 1.5,\ \Delta^3 f_0 = -2.25,\ \Delta^4 f_0 = -2.5$$
First Derivative (Newton's forward, $p=0$)
$$f'(x_0) = \frac{1}{h}\left[\Delta f_0 - \frac{1}{2}\Delta^2 f_0 + \frac{1}{3}\Delta^3 f_0 - \frac{1}{4}\Delta^4 f_0 + \cdots\right]$$
$$= \frac{1}{0.5}\left[4.375 - \frac{1}{2}(1.5) + \frac{1}{3}(-2.25) - \frac{1}{4}(-2.5)\right]$$
$$= 2\left[4.375 - 0.75 - 0.75 + 0.625\right] = 2(3.5) = 7.0$$
Second Derivative (Newton's forward, $p=0$)
$$f''(x_0) = \frac{1}{h^2}\left[\Delta^2 f_0 - \Delta^3 f_0 + \frac{11}{12}\Delta^4 f_0 - \cdots\right]$$
$$= \frac{1}{(0.5)^2}\left[1.5 - (-2.25) + \frac{11}{12}(-2.5)\right]$$
$$= \frac{1}{0.25}\left[1.5 + 2.25 - 2.2917\right]$$
$$= 4 \times 1.4583 = 5.833$$
Summary
| Derivative | Value |
|---|---|
| $f'(2.5)$ | $7.0$ |
| $f''(2.5)$ | $\approx 5.833$ |
(Interpretation: had the last data point been consistent with a cubic, the $f'=x^2$-related exact values would give $f'(2.5)=21.25$ and $f''(2.5)=15.5$, but working strictly from the tabulated data with truncation at $\Delta^4$ yields the values above.)
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.