Numerical differentiation

From Wikipedia, the free encyclopedia

Numerical differentiation is a technique of numerical analysis to produce an estimate of the derivative of a mathematical function or function subroutine using values from the function and perhaps other knowledge about the function.

A simple two-point estimation is to compute the slope of a nearby secant line through the points (x,f(x)) and (x+h,f(x+h)). Choosing a small number h, h represents a small change in x, and it can be either positive or negative. The slope of this line is

{f(x+h)-f(x)\over h}.

This expression is Newton's difference quotient.

The slope of this secant line differs from the slope of the tangent line by an amount proportional to h. As h approaches zero, the slope of the secant line approaches the slope of the tangent line. Therefore, the true derivative of f at x is the limit of the value of the difference quotient as the secant lines get closer and closer to being a tangent line:

f'(x)=\lim_{h\to 0}{f(x+h)-f(x)\over h}.

Since immediately substituting 0 for h results in division by zero, calculating the derivative directly can be unintuitive.

A simple three-point estimation is to compute the slope of a nearby secant line through the points (x-h,f(x-h)) and (x+h,f(x+h)). The slope of this line is

{f(x+h)-f(x-h)\over 2h}.

More generally, three-point estimation uses the secant line through the points (xh1,f(xh1)) and (x + h2,f(x + h2)). The slope of this line is

{f(x+h_2)-f(x-h_1)\over {h_1+h_2}}.
Example showing the difficulty of choosing  h due to both rounding error and formula error
Example showing the difficulty of choosing h due to both rounding error and formula error

The slope of these secant lines differ from the slope of the tangent line by an amount proportional to h2 so that three-point estimation is a more accurate approximation to the tangent line than two-point estimation when h is small.

An important consideration in practice when the function is approximated using floating point arithmetic is how small of an h to choose. If chosen too small, the subtraction will yield a large rounding error. If too large, the calculation of the slope of the secant line will be more accurate, but the estimate of the slope of the tangent by using the secant could be worse.

Higher order methods approximating the derivative are also possible to derive.

[edit] References

  • Richard L. Burden, J. Douglas Faires (2000), Numerical Analysis, (7th Ed), Brooks/Cole. ISBN 0-534-38216-9

[edit] See also

[edit] External links