Numerical differentiation
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).