Finite difference
Template:Use American English Template:Short description Template:Use mdy dates A finite difference is a mathematical expression of the form f(x + b) − f(x + a)Script error: No such module "Check for unknown parameters".. Finite differences (or the associated difference quotients) are often used as approximations of derivatives, such as in numerical differentiation.
The difference operator, commonly denoted , is the operator that maps a function Template:Mvar to the function defined by A difference equation is a functional equation that involves the finite difference operator in the same way as a differential equation involves derivatives. There are many similarities between difference equations and differential equations. Certain recurrence relations can be written as difference equations by replacing iteration notation with finite differences.
In numerical analysis, finite differences are widely used for approximating derivatives, and the term "finite difference" is often used as an abbreviation of "finite difference approximation of derivatives".[1][2][3]
Finite differences were introduced by Brook Taylor in 1715 and have also been studied as abstract self-standing mathematical objects in works by George Boole (1860), L. M. Milne-Thomson (1933), and Template:Interlanguage link (1939). Finite differences trace their origins back to one of Jost Bürgi's algorithms (c. Template:TrimScript error: No such module "Check for unknown parameters".) and work by others including Isaac Newton. The formal calculus of finite differences can be viewed as an alternative to the calculus of infinitesimals.[4]
Basic types
Three basic types are commonly considered: forward, backward, and central finite differences.[1][2][3]
A Template:Vanchor, denoted of a function Template:Mvar is a function defined as
Depending on the application, the spacing Template:Mvar may be variable or constant. When not specified, the default value for Template:Mvar is 1; that is,
A Template:Vanchor uses the function values at Template:Mvar and x − hScript error: No such module "Check for unknown parameters"., instead of the values at x + hScript error: No such module "Check for unknown parameters". and Template:Mvar:
Finally, the Template:Vanchor is given by
Relation with derivatives
Script error: No such module "Labelled list hatnote". Script error: No such module "anchor". The approximation of derivatives by finite differences plays a central role in finite difference methods for the numerical solution of differential equations, especially boundary value problems.
The derivative of a function Template:Mvar at a point Template:Mvar is defined by the limit
If Template:Mvar has a fixed (non-zero) value instead of approaching zero, then the right-hand side of the above equation would be written
Hence, the forward difference divided by Template:Mvar approximates the derivative when Template:Mvar is small. The error in this approximation can be derived from Taylor's theorem. Assuming that Template:Mvar is twice differentiable, we have
The same formula holds for the backward difference:
However, the central (also called centered) difference yields a more accurate approximation. If Template:Mvar is three times differentiable,
The main problemScript error: No such module "Unsubst". with the central difference method, however, is that oscillating functions can yield zero derivative. If f(nh) = 1Script error: No such module "Check for unknown parameters". for Template:Mvar odd, and f(nh) = 2Script error: No such module "Check for unknown parameters". for Template:Mvar even, then f′(nh) = 0Script error: No such module "Check for unknown parameters". if it is calculated with the central difference scheme. This is particularly troublesome if the domain of Template:Mvar is discrete. See also Symmetric derivative.
Authors for whom finite differences mean finite difference approximations define the forward/backward/central differences as the quotients given in this section (instead of employing the definitions given in the previous section).[1][2][3]
Higher-order differences
Script error: No such module "Unsubst".
In an analogous way, one can obtain finite difference approximations to higher order derivatives and differential operators. For example, by using the above central difference formula for f ′(x + Template:Sfrac)Script error: No such module "Check for unknown parameters". and f ′(x − Template:Sfrac)Script error: No such module "Check for unknown parameters". and applying a central difference formula for the derivative of f ′Script error: No such module "Check for unknown parameters". at Template:Mvar, we obtain the central difference approximation of the second derivative of Template:Mvar :
- Second-order central
Similarly we can apply other differencing formulas in a recursive manner.
- Second-order forward
- Second-order backward
More generally, the Template:Mvar-th order forward, backward, and central differences are given by, respectively,
- Forward
- Backward
- Central
These equations use binomial coefficients after the summation sign shown as Each row of Pascal's triangle provides the coefficient for each value of Template:Mvar .
Note that the central difference will, for odd Template:Mvar, have Template:Mvar multiplied by non-integers. This is often a problem because it amounts to changing the interval of discretization. The problem may be remedied substituting the average of and
Forward differences applied to a sequence are sometimes called the binomial transform of the sequence, and have a number of interesting combinatorial properties. Forward differences may be evaluated using the Nörlund–Rice integral. The integral representation for these types of series is interesting, because the integral can often be evaluated using asymptotic expansion or saddle-point techniques; by contrast, the forward difference series can be extremely hard to evaluate numerically, because the binomial coefficients grow rapidly for large Template:Mvar.
The relationship of these higher-order differences with the respective derivatives is straightforward,
Higher-order differences can also be used to construct better approximations. As mentioned above, the first-order difference approximates the first-order derivative up to a term of order Template:Mvar. However, the combination approximates f ′(x)Script error: No such module "Check for unknown parameters". up to a term of order h2Script error: No such module "Check for unknown parameters".. This can be proven by expanding the above expression in Taylor series, or by using the calculus of finite differences, explained below.
If necessary, the finite difference can be centered about any point by mixing forward, backward, and central differences.
Sometimes, the low order derivatives of a function may be analytically known, but high order derivatives are not. In these cases, the high order derivatives can be approximated by finite difference of low order derivatives, which is often more accurate and numerically more stable than finite difference of the function f (x)Script error: No such module "Check for unknown parameters". itself. This is sometimes called seminumerical differentiation.[5] For example, when the first order derivative f ′(x)Script error: No such module "Check for unknown parameters". is available but the second order derivative f ′′(x)Script error: No such module "Check for unknown parameters". is not, the latter can be approximated by second-order central difference of f ′(x)Script error: No such module "Check for unknown parameters".:
Polynomials
For a given polynomial of degree n ≥ 1Script error: No such module "Check for unknown parameters"., expressed in the function P(x)Script error: No such module "Check for unknown parameters"., with real numbers a ≠ 0Script error: No such module "Check for unknown parameters". and bScript error: No such module "Check for unknown parameters". and lower order terms (if any) marked as Template:Mvar:
After nScript error: No such module "Check for unknown parameters". pairwise differences, the following result can be achieved, where h ≠ 0Script error: No such module "Check for unknown parameters". is a real number marking the arithmetic difference:[6]
Only the coefficient of the highest-order term remains. As this result is constant with respect to xScript error: No such module "Check for unknown parameters"., any further pairwise differences will have the value 0Script error: No such module "Check for unknown parameters"..
Inductive proof
Base case
Let Q(x)Script error: No such module "Check for unknown parameters". be a polynomial of degree 1Script error: No such module "Check for unknown parameters".:
This proves it for the base case.
Inductive step
Let R(x)Script error: No such module "Check for unknown parameters". be a polynomial of degree m − 1Script error: No such module "Check for unknown parameters". where m ≥ 2Script error: No such module "Check for unknown parameters". and the coefficient of the highest-order term be a ≠ 0Script error: No such module "Check for unknown parameters".. Assuming the following holds true for all polynomials of degree m − 1Script error: No such module "Check for unknown parameters".:
Let S(x)Script error: No such module "Check for unknown parameters". be a polynomial of degree mScript error: No such module "Check for unknown parameters".. With one pairwise difference:
As ahm ≠ 0Script error: No such module "Check for unknown parameters"., this results in a polynomial T(x)Script error: No such module "Check for unknown parameters". of degree m − 1Script error: No such module "Check for unknown parameters"., with ahmScript error: No such module "Check for unknown parameters". as the coefficient of the highest-order term. Given the assumption above and m − 1Script error: No such module "Check for unknown parameters". pairwise differences (resulting in a total of mScript error: No such module "Check for unknown parameters". pairwise differences for S(x)Script error: No such module "Check for unknown parameters".), it can be found that:
This completes the proof.
Application
This identity can be used to find the lowest-degree polynomial that intercepts a number of points (x, y)Script error: No such module "Check for unknown parameters". where the difference on the x-axis from one point to the next is a constant h ≠ 0Script error: No such module "Check for unknown parameters".. For example, given the following points:
| x | y |
|---|---|
| 1 | 4 |
| 4 | 109 |
| 7 | 772 |
| 10 | 2641 |
| 13 | 6364 |
We can use a differences table, where for all cells to the right of the first yScript error: No such module "Check for unknown parameters"., the following relation to the cells in the column immediately to the left exists for a cell (a + 1, b + 1)Script error: No such module "Check for unknown parameters"., with the top-leftmost cell being at coordinate (0, 0)Script error: No such module "Check for unknown parameters".:
To find the first term, the following table can be used:
| xScript error: No such module "Check for unknown parameters". | yScript error: No such module "Check for unknown parameters". | ΔyScript error: No such module "Check for unknown parameters". | Δ2yScript error: No such module "Check for unknown parameters". | Δ3yScript error: No such module "Check for unknown parameters". |
|---|---|---|---|---|
| 1 | 4 | |||
| 4 | 109 | 105 | ||
| 7 | 772 | 663 | 558 | |
| 10 | 2641 | 1869 | 1206 | 648 |
| 13 | 6364 | 3723 | 1854 | 648 |
This arrives at a constant 648Script error: No such module "Check for unknown parameters".. The arithmetic difference is h = 3Script error: No such module "Check for unknown parameters"., as established above. Given the number of pairwise differences needed to reach the constant, it can be surmised this is a polynomial of degree 3Script error: No such module "Check for unknown parameters".. Thus, using the identity above:
Solving for aScript error: No such module "Check for unknown parameters"., it can be found to have the value 4Script error: No such module "Check for unknown parameters".. Thus, the first term of the polynomial is 4x3Script error: No such module "Check for unknown parameters"..
Then, subtracting out the first term, which lowers the polynomial's degree, and finding the finite difference again:
| Template:Mvar | Template:Mvar | ΔyScript error: No such module "Check for unknown parameters". | Δ2yScript error: No such module "Check for unknown parameters". |
|---|---|---|---|
| 1 | 4 − 4(1)3 = 4 − 4 = 0Script error: No such module "Check for unknown parameters". | ||
| 4 | 109 − 4(4)3 = 109 − 256 = −147Script error: No such module "Check for unknown parameters". | −147 | |
| 7 | 772 − 4(7)3 = 772 − 1372 = −600Script error: No such module "Check for unknown parameters". | −453 | −306 |
| 10 | 2641 − 4(10)3 = 2641 − 4000 = −1359Script error: No such module "Check for unknown parameters". | −759 | −306 |
| 13 | 6364 − 4(13)3 = 6364 − 8788 = −2424Script error: No such module "Check for unknown parameters". | −1065 | −306 |
Here, the constant is achieved after only two pairwise differences, thus the following result:
Solving for aScript error: No such module "Check for unknown parameters"., which is −17Script error: No such module "Check for unknown parameters"., the polynomial's second term is −17x2Script error: No such module "Check for unknown parameters"..
Moving on to the next term, by subtracting out the second term:
| xScript error: No such module "Check for unknown parameters". | yScript error: No such module "Check for unknown parameters". | ΔyScript error: No such module "Check for unknown parameters". |
|---|---|---|
| 1 | 0 − (−17(1)2) = 0 + 17 = 17Script error: No such module "Check for unknown parameters". | |
| 4 | −147 − (−17(4)2) = −147 + 272 = 125Script error: No such module "Check for unknown parameters". | 108 |
| 7 | −600 − (−17(7)2) = −600 + 833 = 233 Script error: No such module "Check for unknown parameters". | 108 |
| 10 | −1359 − (−17(10)2) = −1359 + 1700 = 341 Script error: No such module "Check for unknown parameters". | 108 |
| 13 | −2424 − (−17(13)2) = −2424 + 2873 = 449 Script error: No such module "Check for unknown parameters". | 108 |
Thus the constant is achieved after only one pairwise difference:
It can be found that a = 36Script error: No such module "Check for unknown parameters". and thus the third term of the polynomial is 36xScript error: No such module "Check for unknown parameters".. Subtracting out the third term:
| xScript error: No such module "Check for unknown parameters". | yScript error: No such module "Check for unknown parameters". |
|---|---|
| 1 | 17 − 36(1) = 17 − 36 = −19Script error: No such module "Check for unknown parameters". |
| 4 | 125 − 36(4) = 125 − 144 = −19Script error: No such module "Check for unknown parameters". |
| 7 | 233 − 36(7) = 233 − 252 = −19Script error: No such module "Check for unknown parameters". |
| 10 | 341 − 36(10) = 341 − 360 = −19Script error: No such module "Check for unknown parameters". |
| 13 | 449 − 36(13) = 449 − 468 = −19Script error: No such module "Check for unknown parameters". |
Without any pairwise differences, it is found that the 4th and final term of the polynomial is the constant −19Script error: No such module "Check for unknown parameters".. Thus, the lowest-degree polynomial intercepting all the points in the first table is found:
Arbitrarily sized kernels
Script error: No such module "Labelled list hatnote". Script error: No such module "labelled list hatnote".
Using linear algebra one can construct finite difference approximations which utilize an arbitrary number of points to the left and a (possibly different) number of points to the right of the evaluation point, for any order derivative. This involves solving a linear system such that the Taylor expansion of the sum of those points around the evaluation point best approximates the Taylor expansion of the desired derivative. Such formulas can be represented graphically on a hexagonal or diamond-shaped grid.[7] This is useful for differentiating a function on a grid, where, as one approaches the edge of the grid, one must sample fewer and fewer points on one side.[8] Finite difference approximations for non-standard (and even non-integer) stencils given an arbitrary stencil and a desired derivative order may be constructed.[9]
Properties
- For all positive Template:Mvar and Template:Mvar
- Leibniz rule:
In differential equations
Template:Main article An important application of finite differences is in numerical analysis, especially in numerical differential equations, which aim at the numerical solution of ordinary and partial differential equations. The idea is to replace the derivatives appearing in the differential equation by finite differences that approximate them. The resulting methods are called finite difference methods.
Common applications of the finite difference method are in computational science and engineering disciplines, such as thermal engineering, fluid mechanics, etc.
Newton's series
The Newton series consists of the terms of the Newton forward difference equation, named after Isaac Newton; in essence, it is the Gregory–Newton interpolation formula[10] (named after Isaac Newton and James Gregory), first published in his Principia Mathematica in 1687,[11][12] namely the discrete analog of the continuous Taylor expansion,
Template:Equation box 1 which holds for any polynomial function Template:Mvar and for many (but not all) analytic functions. (It does not hold when Template:Mvar is exponential type . This is easily seen, as the sine function vanishes at integer multiples of ; the corresponding Newton series is identically zero, as all finite differences are zero in this case. Yet clearly, the sine function is not zero.) Here, the expression is the binomial coefficient, and is the "falling factorial" or "lower factorial", while the empty product (x)0Script error: No such module "Check for unknown parameters". is defined to be 1. In this particular case, there is an assumption of unit steps for the changes in the values of x, h = 1Script error: No such module "Check for unknown parameters". of the generalization below.
Note the formal correspondence of this result to Taylor's theorem. Historically, this, as well as the Chu–Vandermonde identity, (following from it, and corresponding to the binomial theorem), are included in the observations that matured to the system of umbral calculus.
Newton series expansions can be superior to Taylor series expansions when applied to discrete quantities like quantum spins (see Holstein–Primakoff transformation), bosonic operator functions or discrete counting statistics.[13]
To illustrate how one may use Newton's formula in actual practice, consider the first few terms of doubling the Fibonacci sequence f = 2, 2, 4, ...Script error: No such module "Check for unknown parameters". One can find a polynomial that reproduces these values, by first computing a difference table, and then substituting the differences that correspond to x0Script error: No such module "Check for unknown parameters". (underlined) into the formula as follows,
For the case of nonuniform steps in the values of Template:Mvar, Newton computes the divided differences, the series of products, and the resulting polynomial is the scalar product,[14]
In analysis with [[p-adic number|Template:Mvar-adic numbers]], Mahler's theorem states that the assumption that Template:Mvar is a polynomial function can be weakened all the way to the assumption that Template:Mvar is merely continuous.
Carlson's theorem provides necessary and sufficient conditions for a Newton series to be unique, if it exists. However, a Newton series does not, in general, exist.
The Newton series, together with the Stirling series and the Selberg series, is a special case of the general difference series, all of which are defined in terms of suitably scaled forward differences.
In a compressed and slightly more general form and equidistant nodes the formula reads
Calculus of finite differences
The forward difference can be considered as an operator, called the difference operator, which maps the function Template:Mvar to Δh[f]Script error: No such module "Check for unknown parameters"..[15][16] This operator amounts to where ThScript error: No such module "Check for unknown parameters". is the shift operator with step Template:Mvar, defined by Th[f](x) = f(x + h)Script error: No such module "Check for unknown parameters"., and IScript error: No such module "Check for unknown parameters". is the identity operator.
The finite difference of higher orders can be defined in recursive manner as ΔScript error: No such module "Su". ≡ Δh(ΔScript error: No such module "Su".)Script error: No such module "Check for unknown parameters".. Another equivalent definition is ΔScript error: No such module "Su". ≡ [Th − I]nScript error: No such module "Check for unknown parameters"..
The difference operator ΔhScript error: No such module "Check for unknown parameters". is a linear operator, as such it satisfies Δh[α f + β g](x) = α Δh[f](x) + β Δh[g](x)Script error: No such module "Check for unknown parameters"..
It also satisfies a special Leibniz rule:
Similar Leibniz rules hold for the backward and central differences.
Formally applying the Taylor series with respect to Template:Mvar, yields the operator equation where DScript error: No such module "Check for unknown parameters". denotes the conventional, continuous derivative operator, mapping Template:Mvar to its derivative f′Script error: No such module "Check for unknown parameters".. The expansion is valid when both sides act on analytic functions, for sufficiently small Template:Mvar; in the special case that the series of derivatives terminates (when the function operated on is a finite polynomial) the expression is exact, for all finite stepsizes, Template:Mvar . Thus Th = eh DScript error: No such module "Check for unknown parameters"., and formally inverting the exponential yields This formula holds in the sense that both operators give the same result when applied to a polynomial.
Even for analytic functions, the series on the right is not guaranteed to converge; it may be an asymptotic series. However, it can be used to obtain more accurate approximations for the derivative. For instance, retaining the first two terms of the series yields the second-order approximation to f ′(x)Script error: No such module "Check for unknown parameters". mentioned at the end of the section Template:Slink.
The analogous formulas for the backward and central difference operators are
The calculus of finite differences is related to the umbral calculus of combinatorics. This remarkably systematic correspondence is due to the identity of the commutators of the umbral quantities to their continuum analogs (h → 0Script error: No such module "Check for unknown parameters". limits),
A large number of formal differential relations of standard calculus involving functions f(x)Script error: No such module "Check for unknown parameters". thus systematically map to umbral finite-difference analogs involving f( x TScript error: No such module "Su". )Script error: No such module "Check for unknown parameters"..
For instance, the umbral analog of a monomial Template:Mvar is a generalization of the above falling factorial (Pochhammer k-symbol), so that hence the above Newton interpolation formula (by matching coefficients in the expansion of an arbitrary function f(x)Script error: No such module "Check for unknown parameters". in such symbols), and so on.
For example, the umbral sine is
As in the continuum limit, the eigenfunction of Template:SfracScript error: No such module "Check for unknown parameters". also happens to be an exponential,
and hence Fourier sums of continuum functions are readily, faithfully mapped to umbral Fourier sums, i.e., involving the same Fourier coefficients multiplying these umbral basis exponentials.[17] This umbral exponential thus amounts to the exponential generating function of the Pochhammer symbols.
Thus, for instance, the Dirac delta function maps to its umbral correspondent, the cardinal sine function and so forth.[18] Difference equations can often be solved with techniques very similar to those for solving differential equations.
The inverse operator of the forward difference operator, so then the umbral integral, is the indefinite sum or antidifference operator.
Rules for calculus of finite difference operators
Analogous to rules for finding the derivative, we have:
- Constant rule: If Template:Mvar is a constant, then
- Linearity: If Template:Mvar and Template:Mvar are constants,
All of the above rules apply equally well to any difference operator as to ΔScript error: No such module "Check for unknown parameters"., including δScript error: No such module "Check for unknown parameters". and ∇Script error: No such module "Check for unknown parameters"..
See references.[19][20][21][22]
Generalizations
- A generalized finite difference is usually defined as where μ = (μ0, …, μN)Script error: No such module "Check for unknown parameters". is its coefficient vector. An infinite difference is a further generalization, where the finite sum above is replaced by an infinite series. Another way of generalization is making coefficients μkScript error: No such module "Check for unknown parameters". depend on point Template:Mvar: μk = μk(x)Script error: No such module "Check for unknown parameters"., thus considering weighted finite difference. Also one may make the step Template:Mvar depend on point Template:Mvar: h = h(x)Script error: No such module "Check for unknown parameters".. Such generalizations are useful for constructing different modulus of continuity.
- The generalized difference can be seen as the polynomial rings R[Th]Script error: No such module "Check for unknown parameters".. It leads to difference algebras.
- Difference operator generalizes to Möbius inversion over a partially ordered set.
- As a convolution operator: Via the formalism of incidence algebras, difference operators and other Möbius inversion can be represented by convolution with a function on the poset, called the Möbius function Template:Mvar; for the difference operator, Template:Mvar is the sequence (1, −1, 0, 0, 0, …).
Multivariate finite differences
Finite differences can be considered in more than one variable. They are analogous to partial derivatives in several variables.
Some partial derivative approximations are:
Alternatively, for applications in which the computation of Template:Mvar is the most costly step, and both first and second derivatives must be computed, a more efficient formula for the last case is since the only values to compute that are not already needed for the previous four equations are f(x + h, y + k)Script error: No such module "Check for unknown parameters". and f(x − h, y − k)Script error: No such module "Check for unknown parameters"..
For functions with variables , evaluating the full -th order derivative tensor via finite difference requires calls of the function (where we have used the Big O notation to denote the asymptotic scaling behavior), or calls of the -th order derivative of the function (where ). However, for many classes of functions, the -th order derivative tensor is sparse, or its off-diagonal blocks may have low rank. In these cases, algorithms may exist that can numerically estimate the -th order derivative tensor using less than calls of the -th order derivative, for example when and ; in the latter case it is possible to estimate the Hessian matrix using only gradients, instead of gradients as would be required by the conventional finite difference algorithm.[23]
See also
Script error: No such module "Template wrapper".Script error: No such module "Check for unknown parameters".
References
- ↑ a b c Script error: No such module "citation/CS1".
- ↑ a b c Script error: No such module "citation/CS1".
- ↑ a b c Script error: No such module "citation/CS1".
- ↑ Jordán, op. cit., p. 1 and Milne-Thomson, p. xxi. Milne-Thomson, Louis Melville (2000): The Calculus of Finite Differences (Chelsea Pub Co, 2000) Template:ISBN
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "Citation/CS1".
- ↑ notes
- ↑ Finite Difference Coefficients Calculator
- ↑ Burkard Polster/Mathologer (2021). " Why don't they teach Newton's calculus of 'What comes next?' " on YouTube
- ↑ Newton, Isaac, (1687). Principia, Book III, Lemma V, Case 1
- ↑ Script error: No such module "Citation/CS1".
- ↑ Script error: No such module "Citation/CS1".
- ↑ Richtmeyer, D. and Morton, K.W., (1967). Difference Methods for Initial Value Problems, 2nd ed., Wiley, New York.
- ↑ Script error: No such module "citation/CS1". Also, a Dover reprint edition, 1960.
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "Citation/CS1".
- ↑ Script error: No such module "Citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "Citation/CS1".
- ↑ Script error: No such module "citation/CS1".
<templatestyles src="Refbegin/styles.css" />
- Richardson, C. H. (1954): An Introduction to the Calculus of Finite Differences (Van Nostrand (1954) online copy
- Mickens, R. E. (1991): Difference Equations: Theory and Applications (Chapman and Hall/CRC) Template:ISBN