TOPICS
Search

Finite Difference


The finite difference is the discrete analog of the derivative. The finite forward difference of a function f_p is defined as

 Deltaf_p=f_(p+1)-f_p,
(1)

and the finite backward difference as

 del f_p=f_p-f_(p-1).
(2)

The forward finite difference is implemented in the Wolfram Language as DifferenceDelta[f, i].

If the values are tabulated at spacings h, then the notation

 f_p=f(x_0+ph)=f(x)
(3)

is used. The kth forward difference would then be written as Delta^kf_p, and similarly, the kth backward difference as del ^kf_p.

However, when f_p is viewed as a discretization of the continuous function f(x), then the finite difference is sometimes written

Deltaf(x)=f(x+1/2)-f(x-1/2)
(4)
=2AdjustmentBox[I, BoxMargins -> {{0.101266, -0.101266}, {0.375, -0.375}}, BoxBaselineShift -> -0.375]AdjustmentBox[I, BoxMargins -> {{0, 0}, {-0.25, 0.25}}, BoxBaselineShift -> 0.25](x)*f(x),
(5)

where * denotes convolution and AdjustmentBox[I, BoxMargins -> {{0.101266, -0.101266}, {0.375, -0.375}}, BoxBaselineShift -> -0.375]AdjustmentBox[I, BoxMargins -> {{0, 0}, {-0.25, 0.25}}, BoxBaselineShift -> 0.25](x) is the odd impulse pair. The finite difference operator can therefore be written

 Delta^~=2AdjustmentBox[I, BoxMargins -> {{0.101266, -0.101266}, {0.375, -0.375}}, BoxBaselineShift -> -0.375]AdjustmentBox[I, BoxMargins -> {{0, 0}, {-0.25, 0.25}}, BoxBaselineShift -> 0.25]*.
(6)

An nth power has a constant nth finite difference. For example, take n=3 and make a difference table,

 x; 1; 2; 3; 4; 5x^3; 1; 8; 27; 64; 125Delta; 7; 19; 37; 61Delta^2; 12; 18; 24Delta^3; 6; 6Delta^4; 0.
(7)

The Delta^3 column is the constant 6.

Finite difference formulas can be very useful for extrapolating a finite amount of data in an attempt to find the general term. Specifically, if a function f(n) is known at only a few discrete values n=0, 1, 2, ... and it is desired to determine the analytical form of f, the following procedure can be used if f is assumed to be a polynomial function. Denote the nth value in the sequence of interest by a_n. Then define b_n as the forward difference Delta_n=a_(n+1)-a_n, c_n as the second forward difference Delta_n^2=b_(n+1)-b_n, etc., constructing a table as follows

 a_0=f(0)  a_1=f(1)  a_2=f(2)  ...  a_p=f(p)
(8)
   b_0=a_1-a_0  b_1=a_2-a_1  ...  b_(p-1)=a_p-a_(p-1)
(9)
 c_0=b_1-b_0  ...  ...
(10)
 ...
(11)

Continue computing d_0, e_0, etc., until a 0 value is obtained. Then the polynomial function giving the values a_n is given by

f(n)=sum_(k=0)^(p)alpha_k(n; k)
(12)
=a_0+b_0n+(c_0n(n-1))/2+(d_0n(n-1)(n-2))/(2·3)+....
(13)

When the notation Delta_0=a_0, Delta_0^2=b_0, etc., is used, this beautiful equation is called Newton's forward difference formula. To see a particular example, consider a sequence with first few values of 1, 19, 143, 607, 1789, 4211, and 8539. The difference table is then given by

 1  19  143  607  1789  4211  8539
18  124  464  1182  2422  4328
106  340  718  1240  1906
234  378  522  666
144  144  144
0  0
(14)

Reading off the first number in each row gives a_0=1, b_0=18, c_0=106, d_0=234, e_0=144. Plugging these in gives the equation

f(n)=1+18n+1/2106n(n-1)+1/6234n(n-1)(n-2)+1/(24)144n(n-1)(n-2)(n-3)
(15)
=6n^4+3n^3+2n^2+7n+1,
(16)

which indeed fits the original data exactly.

Formulas for the derivatives are given by

f^'(x_0)=1/h[f(x_0+h)-f(x_0)]-1/2hf^('')(xi)
(17)
=1/(2h)[-3f(x_0)+4f(x_0+h)-f(x_0+2h)]+1/3h^2f^((3))(xi)
(18)
=1/(2h)[f(x_0+h)-f(x_0-h)]-1/6h^2f^((3))(xi)
(19)
=1/(12h)(f_(-2)-8f_(-1)+8f_1-f_2)+1/(30)h^4f^((5))(xi)
(20)
=1/(12h)(-25f_0+48f_1-36f_2+16f_3-3f_4)+1/5h^4f^((5))(xi)
(21)
f^('')(x_0)=1/(h^2)(f_(-1)-2f_0+f_1)-1/(12)h^2f^((4))(xi)
(22)
=1/(h^2)(f_0-2f_1+f_2)+1/6h^2f^((4))(xi_1)-hf^((3))(xi_2)
(23)
f^((3))(x_0)=1/(h^3)(f_3-3f_2+3f_1-f_0)+O(h)
(24)
=1/(2h^3)(f_2-2f_1+2f_(-1)-f_(-2))+O(h^2)
(25)
f^((4))(x_0)=1/(h^4)(f_4-4f_3+6f_2-4f_1+f_0)+O(h)
(26)
=1/(h^4)(f_2-4f_1+6f_0-4f_(-1)+f_(-2))+O(h^2)
(27)

(Beyer 1987, pp. 449-451; Zwillinger 1995, p. 705).

Formulas for integrals of finite differences

 int_(x_0)^(x_n)f(x)dx=hint_0^nf_pdp
(28)

are given by Beyer (1987, pp. 455-456).

Finite differences lead to difference equations, finite analogs of differential equations. In fact, umbral calculus displays many elegant analogs of well-known identities for continuous functions. Common finite difference schemes for partial differential equations include the so-called Crank-Nicolson, Du Fort-Frankel, and Laasonen methods.


See also

Backward Difference, Bessel's Finite Difference Formula, Derivative, Difference Equation, Difference Table, Everett's Formula, Finite Element Method, Forward Difference, Gauss's Backward Formula, Gauss's Forward Formula, Interpolation, Jackson's Difference Fan, Newton's Backward Difference Formula, Newton-Cotes Formulas, Newton's Divided Difference Interpolation Formula, Newton's Forward Difference Formula, Quotient-Difference Table, Recurrence Equation, Steffenson's Formula, Stirling's Finite Difference Formula, Umbral Calculus

Explore with Wolfram|Alpha

References

Abramowitz, M. and Stegun, I. A. (Eds.). "Differences." §25.1 in Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables, 9th printing. New York: Dover, pp. 877-878, 1972.Beyer, W. H. CRC Standard Mathematical Tables, 28th ed. Boca Raton, FL: CRC Press, pp. 429-515, 1987.Boole, G. and Moulton, J. F. A Treatise on the Calculus of Finite Differences, 2nd rev. ed. New York: Dover, 1960.Conway, J. H. and Guy, R. K. "Newton's Useful Little Formula." In The Book of Numbers. New York: Springer-Verlag, pp. 81-83, 1996.Fornberg, B. "Calculation of Weights in Finite Difference Formulas." SIAM Rev. 40, 685-691, 1998.Iyanaga, S. and Kawada, Y. (Eds.). "Interpolation." Appendix A, Table 21 in Encyclopedic Dictionary of Mathematics. Cambridge, MA: MIT Press, pp. 1482-1483, 1980.Jordan, C. Calculus of Finite Differences, 3rd ed. New York: Chelsea, 1965.Levy, H. and Lessman, F. Finite Difference Equations. New York: Dover, 1992.Milne-Thomson, L. M. The Calculus of Finite Differences. London: Macmillan, 1951.Richardson, C. H. An Introduction to the Calculus of Finite Differences. New York: Van Nostrand, 1954.Spiegel, M. Calculus of Finite Differences and Differential Equations. New York: McGraw-Hill, 1971.Stirling, J. Methodus differentialis, sive tractatus de summation et interpolation serierum infinitarium. London, 1730. English translation by Holliday, J. The Differential Method: A Treatise of the Summation and Interpolation of Infinite Series. 1749.Tweddle, C. James Stirling: A Sketch of His Life and Works Along with his Scientific Correspondence. Oxford, England: Oxford University Press, pp. 30-45, 1922.Weisstein, E. W. "Books about Finite Difference Equations." http://www.ericweisstein.com/encyclopedias/books/FiniteDifferenceEquations.html.Zwillinger, D. (Ed.). "Difference Equations" and "Numerical Differentiation." §3.9 and 8.3.2 in CRC Standard Mathematical Tables and Formulae. Boca Raton, FL: CRC Press, pp. 228-235 and 705-705, 1995.

Referenced on Wolfram|Alpha

Finite Difference

Cite this as:

Weisstein, Eric W. "Finite Difference." From MathWorld--A Wolfram Web Resource. https://mathworld.wolfram.com/FiniteDifference.html

Subject classifications