Numerical Differentiation - Finite Difference Formula

Finite Difference Formula

The simplest method is to use finite difference approximations.

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

This expression is Newton's difference quotient.

The slope of this secant line differs from the slope of the tangent line by an amount that is approximately 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:

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

Equivalently, the slope could be estimated by employing positions (x - h) and x.

Another two-point formula 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

In this case the first-order errors cancel, so the slope of these secant lines differ from the slope of the tangent line by an amount that is approximately proportional to . Hence for small values of h this is a more accurate approximation to the tangent line than the one-sided estimation. Note however that although the slope is being computed at x, the value of the function at x is not involved.

The estimation error is given by:

,

where is some point between and . This error does not include the rounding error due to numbers being represented and calculations being performed in limited precision.

Read more about this topic:  Numerical Differentiation

Famous quotes containing the words finite, difference and/or formula:

    The finite is annihilated in the presence of the infinite, and becomes a pure nothing. So our spirit before God, so our justice before divine justice.
    Blaise Pascal (1623–1662)

    It occurred to me that there was no difference between men, in intelligence or race, so profound as the difference between the sick and the well.
    F. Scott Fitzgerald (1896–1940)

    I take it that what all men are really after is some form or perhaps only some formula of peace.
    Joseph Conrad (1857–1924)