Numerical differentiation: Difference between revisions
No edit summary |
|||
| Line 24: | Line 24: | ||
! Method !! Computed approximate value to <math>f'(x)</math> !! Error term (computed value minus actual value) !! Order of convergence (smallest exponent on <math>h</matH> with nonzero coefficient in Taylor expansion of error) -- higher order is better | ! Method !! Computed approximate value to <math>f'(x)</math> !! Error term (computed value minus actual value) !! Order of convergence (smallest exponent on <math>h</matH> with nonzero coefficient in Taylor expansion of error) -- higher order is better | ||
|- | |- | ||
| forward [[difference quotient]] <math>\frac{f(x + h) - f(x)}{h}</math> || <math>f'(x) + \frac{h}{2}f''(x) + \frac{h^ | | forward [[difference quotient]] <math>\frac{f(x + h) - f(x)}{h}</math> || <math>f'(x) + \frac{h}{2}f''(x) + \frac{h^3}{6}f'''(x) + \dots</math> || <math>\frac{h}{2}f''(x) + \frac{h^2}{6}f'''(x) + \dots</math> || 1 | ||
|- | |- | ||
| backward [[difference quotient]] <math>\frac{f(x) - f(x - h)}{h}</math> || <math>f'(x) - \frac{h}{2}f''(x) + \frac{h^ | | backward [[difference quotient]] <math>\frac{f(x) - f(x - h)}{h}</math> || <math>f'(x) - \frac{h}{2}f''(x) + \frac{h^3}{6}f'''(x) + \dots</math> || <math>- \frac{h}{2}f''(x) + \frac{h^2}{6}f'''(x) + \dots</math> || 1 | ||
|- | |- | ||
| central difference quotient <math>\frac{f(x + (h/2)) - f(x - (h/2))}{h}</math> || <math>f'(x) + \frac{h^2}{12}f'''(x) + \dots</math> || <math>\frac{h^2}{12}f'''(x) + \dots</math> || 2 | | central difference quotient <math>\frac{f(x + (h/2)) - f(x - (h/2))}{h}</math> || <math>f'(x) + \frac{h^2}{12}f'''(x) + \dots</math> || <math>\frac{h^2}{12}f'''(x) + \dots</math> || 2 | ||
Revision as of 02:40, 31 May 2014
Definition
Numerical differentiation refers to a method for computing the approximate numerical value of the derivative of a function at a point in the domain as a difference quotient. Explicitly, the numerical derivative of a function at a point may be computed using either of these three formulas, for a sufficiently small positive real number:
| Expression | Interpretation of limit as |
|---|---|
| Forward difference quotient , comes from the forward difference form of the finite difference | The right-hand derivative . If is differentiable at , this equals the two-sided derivative . |
| Backward difference quotient , comes from the backward difference form of the finite difference | The left-hand derivative . If is differentiable at , this equals the two-sided derivative . |
| Central difference quotient , comes from the central difference form of the finite difference | If is differentiable at , this equals the two-sided derivative . Otherwise, however, it does not have any direct interpretation as a one-sided derivative of . |
Relative precision of the formulas
Suppose that has a Taylor series around . In other words, we can expand:
In this case, the three methods for approximating the derivative give us the following results:
| Method | Computed approximate value to | Error term (computed value minus actual value) | Order of convergence (smallest exponent on with nonzero coefficient in Taylor expansion of error) -- higher order is better |
|---|---|---|---|
| forward difference quotient | 1 | ||
| backward difference quotient | 1 | ||
| central difference quotient | 2 |
We therefore see that the central difference quotient computes a substantially more precise value for the derivative.
Note that we for the result above to hold, we do not require the function to have a Taylor series; we only need the function to be three or more times continuously differentiable (in fact, a somewhat weaker version holds if the function is only twice continuously differentiable).