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 slopes of a nearby secant line. Choosing a small number h, h represents a small change in x, and it can be either positive or negative. The slope of the line through the points (x,f(x)) and (x+h,f(x+h)) is

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

This expression is Newton's difference quotient.

Note that 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 computed as the average of the slopes of two nearby secant lines. Choose a small number h. For one slope we use the two-point estimate from above. The other is the slope of the line through the points (x-h,f(x-h)) and (x,f(x)) is

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

Combining the slopes we find the three-point formula:

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

Other higher order methods are possible. 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.

[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