Finite difference explained

A finite difference is a mathematical expression of the form . If a finite difference is divided by, one gets a difference quotient. 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 difference operator, commonly denoted

\Delta

is the operator that maps a function to the function

\Delta[f]

defined by\Delta[f](x) = f(x+1)-f(x).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, specially in the solving methods. 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 difference approximations are finite difference quotients in the terminology employed above.

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 (1939). Finite differences trace their origins back to one of Jost Bürgi's algorithms 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 , denoted

\Deltah[f],

of a function is a function defined as \Delta_h[f](x) = f(x + h) - f(x).

Depending on the application, the spacing may be variable or constant. When omitted, is taken to be 1; that is, \Delta[f](x) = \Delta_1[f](x) =f(x+1)-f(x) .

A uses the function values at and, instead of the values at and : \nabla_h[f](x) = f(x) - f(x-h)=\Delta_h[f](x-h).

Finally, the is given by \delta_h[f](x) = f(x+\tfrac2)-f(x-\tfrac2)=\Delta_[f](x)+\nabla_[f](x).

Relation with derivatives

Finite difference is often used as an approximation of the derivative, typically in numerical differentiation.

The derivative of a function at a point is defined by the limit f'(x) = \lim_ \frac.

If has a fixed (non-zero) value instead of approaching zero, then the right-hand side of the above equation would be written \frac = \frac.

Hence, the forward difference divided by approximates the derivative when is small. The error in this approximation can be derived from Taylor's theorem. Assuming that is twice differentiable, we have \frac - f'(x) = o(h)\to 0 \quad \texth \to 0.

The same formula holds for the backward difference: \frac - f'(x) = o(h)\to 0 \quad \texth \to 0.

However, the central (also called centered) difference yields a more accurate approximation. If is three times differentiable, \frac - f'(x) = o\left(h^2\right) .

The main problem with the central difference method, however, is that oscillating functions can yield zero derivative. If for odd, and for even, then if it is calculated with the central difference scheme. This is particularly troublesome if the domain of 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

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 and and applying a central difference formula for the derivative of at, we obtain the central difference approximation of the second derivative of :

Second-order central :

f''(x)

2[f](x)
\delta
h
h2

=

f(x+h)-f(x)
h
-
f(x)-f(x-h)
h
h

=

f(x+h)-2f(x)+f(x-h)
h2

.

Similarly we can apply other differencing formulas in a recursive manner.

Second order forward :

f''(x)

2[f](x)
\Delta
h
h2

=

f(x+2h)-f(x+h)
h
-
f(x+h)-f(x)
h
h

=

f(x+2h)-2f(x+h)+f(x)
h2

.

Second order backward :

f''(x)

2[f](x)
\nabla
h
h2

=

f(x)-f(x-h)
h
-
f(x-h)-f(x-2h)
h
h

=

f(x)-2f(x-h)+f(x-2h)
h2

.

More generally, the -th order forward, backward, and central differences are given by, respectively,

Forward :
n
\Delta
h[f](x)

=

n
\sum
i=0

(-1)n-i\binom{n}{i}fl(x+ihr),

Backward :
n
\nabla
h[f](x)

=

n
\sum
i=0

(-1)i\binom{n}{i}f(x-ih),

Central :
n
\delta
h[f](x)

=

n
\sum
i=0

(-1)i\binom{n}{i}f\left(x+\left(

n
2

-i\right)h\right).

These equations use binomial coefficients after the summation sign shown as . Each row of Pascal's triangle provides the coefficient for each value of .

Note that the central difference will, for odd, have multiplied by non-integers. This is often a problem because it amounts to changing the interval of discretization. The problem may be remedied taking 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 .

The relationship of these higher-order differences with the respective derivatives is straightforward,\frac(x) = \frac+o(h) = \frac+o(h) = \frac + o\left(h^2\right).

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 . However, the combination \frac = - \frac approximates up to a term of order . 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.

Polynomials

For a given polynomial of degree, expressed in the function, with real numbers and and lower order terms (if any) marked as :P(x) = ax^n + bx^ + l.o.t.

After pairwise differences, the following result can be achieved, where is a real number marking the arithmetic difference:[5] \Delta_h^n [P](x) = ah^nn!

Only the coefficient of the highest-order term remains. As this result is constant with respect to, any further pairwise differences will have the value .

Inductive proof

Base case

Let be a polynomial of degree :\Delta_h [Q](x) = Q(x + h) - Q(x) = [a(x + h) + b] - [ax + b] = ah = ah^11!

This proves it for the base case.

Inductive step

Let be a polynomial of degree where and the coefficient of the highest-order term be . Assuming the following holds true for all polynomials of degree :\Delta_h^ [R](x) = ah^(m-1)!

Let be a polynomial of degree . With one pairwise difference:\Delta_h [S](x) = [a(x+h)^{m} + b(x+h)^{m-1} + \text{l.o.t.}] - [ax^m + bx^{m-1} + \text{l.o.t.}] = ahmx^ + \text = T(x)

As, this results in a polynomial of degree, with as the coefficient of the highest-order term. Given the assumption above and pairwise differences (resulting in a total of pairwise differences for), it can be found that:\Delta_h^ [T](x) = ahm \cdot h^(m-1)! = a h^m m!

This completes the proof.

Application

This identity can be used to find the lowest-degree polynomial that intercepts a number of points where the difference on the x-axis from one point to the next is a constant . 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, the following relation to the cells in the column immediately to the left exists for a cell, with the top-leftmost cell being at coordinate :(a+1, b+1) = (a, b+1) - (a, b)

To find the first term, the following table can be used:

14
4109 105
7772 663 558
102641 1869 1206 648
136364 3723 1854 648

This arrives at a constant . The arithmetic difference is, as established above. Given the number of pairwise differences needed to reach the constant, it can be surmised this is a polynomial of degree . Thus, using the identity above:648 = a \cdot 3^3 \cdot 3! = a \cdot 27 \cdot 6 = a \cdot 162

Solving for, it can be found to have the value . Thus, the first term of the polynomial is .

Then, subtracting out the first term, which lowers the polynomial's degree, and finding the finite difference again:

1
4−147
7−453 −306
10−759 −306
13−1065 −306

Here, the constant is achieved after only two pairwise differences, thus the following result:-306 = a \cdot 3^2 \cdot 2! = a \cdot 18

Solving for, which is, the polynomial's second term is .

Moving on to the next term, by subtracting out the second term:

1
4108
7108
10108
13108

Thus the constant is achieved after only one pairwise difference:108 = a \cdot 3^1 \cdot 1! = a \cdot 3

It can be found that and thus the third term of the polynomial is . Subtracting out the third term:

Without any pairwise differences, it is found that the 4th and final term of the polynomial is the constant . Thus, the lowest-degree polynomial intercepting all the points in the first table is found:4x^3 - 17x^2 + 36x - 19

Arbitrarily sized kernels

See main article: Finite difference coefficient.

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.[6] 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.[7] Finite difference approximations for non-standard (and even non-integer) stencils given an arbitrary stencil and a desired derivative order may be constructed.[8]

Properties

In differential equations

See main article: article and Finite difference method. 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[9] (named after Isaac Newton and James Gregory), first published in his Principia Mathematica in 1687,[10] [11] namely the discrete analog of the continuous Taylor expansion,

\pi

. This is easily seen, as the sine function vanishes at integer multiples of

\pi

; 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\binom = \fracis the binomial coefficient, and(x)_k=x(x-1)(x-2)\cdots(x-k+1)is the "falling factorial" or "lower factorial", while the empty product is defined to be 1. In this particular case, there is an assumption of unit steps for the changes in the values of of the generalization below.

Note the formal correspondence of this result to Taylor's theorem. Historically, this, as well as the Chu–Vandermonde identity, (x+y)_n=\sum_^n \binom (x)_ \,(y)_k,(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.[12]

To illustrate how one may use Newton's formula in actual practice, consider the first few terms of doubling the Fibonacci sequence One can find a polynomial that reproduces these values, by first computing a difference table, and then substituting the differences that correspond to (underlined) into the formula as follows,\begin

\begin

ccc
\hline x & f=\Delta^0 & \Delta^1 & \Delta^2 \\\hline1&\underline& & \\ & &\underline& \\2&2& &\underline \\ & &2& \\3&4& & \\\hline\end

&

\quad \beginf(x) & =\Delta^0 \cdot 1 +\Delta^1 \cdot \dfrac + \Delta^2 \cdot \dfrac \quad (x_0=1)\\ \\& =2 \cdot 1 + 0 \cdot \dfrac + 2 \cdot \dfrac \\ \\& =2 + (x-1)(x-2) \\\end\end

For the case of nonuniform steps in the values of, Newton computes the divided differences,\Delta _=y_j,\qquad \Delta _=\frac\quad \ni \quad \left\,\qquad \Delta 0_k = \Delta _the series of products,=1,\quad \quad P_=P_k\cdot \left(\xi -x_k \right),and the resulting polynomial is the scalar product,[13] f(\xi) = \Delta 0 \cdot P\left(\xi \right).

In analysis with -adic numbers, Mahler's theorem states that the assumption that is a polynomial function can be weakened all the way to the assumption that 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 readsf(x) = \sum_\binom \sum_^k (-1)^\binomf(a+j h).

Calculus of finite differences

The forward difference can be considered as an operator, called the difference operator, which maps the function to .[14] [15] This operator amounts to \Delta_h = T_h-I, where is the shift operator with step h, defined by, and is the identity operator.

The finite difference of higher orders can be defined in recursive manner as . Another equivalent definition is .

The difference operator is a linear operator, as such it satisfies .

It also satisfies a special Leibniz rule indicated above,. Similar statements hold for the backward and central differences.

Formally applying the Taylor series with respect to, yields the formula \Delta_h = hD + \frac h^2D^2 + \frac h^3D^3 + \cdots = e^ - I, where denotes the continuum derivative operator, mapping to its derivative . The expansion is valid when both sides act on analytic functions, for sufficiently small . Thus,, and formally inverting the exponential yields hD = \ln(1+\Delta_h) = \Delta_h - \tfrac \, \Delta_h^2 + \tfrac \, \Delta_h^3 - \cdots. 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 mentioned at the end of the section .

The analogous formulas for the backward and central difference operators are hD = -\ln(1-\nabla_h) \quad\text\quad hD = 2 \operatorname\left(\tfrac12 \, \delta_h\right).

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 (limits),

A large number of formal differential relations of standard calculus involving functions thus map systematically to umbral finite-difference analogs involving .

For instance, the umbral analog of a monomial is a generalization of the above falling factorial (Pochhammer k-symbol), (x)_n\equiv \left(xT_h^\right)^n=x (x-h) (x-2h) \cdots \bigl(x-(n-1)h\bigr), so that \frac (x)_n=n (x)_,hence the above Newton interpolation formula (by matching coefficients in the expansion of an arbitrary function in such symbols), and so on.

For example, the umbral sine is\sin \left(x\,T_h^\right) = x -\frac + \frac - \frac + \cdots

As in the continuum limit, the eigenfunction of also happens to be an exponential,

\Deltah
h

(1+λ

x
h
h)=
\Deltah
h
ln(1+λh)
x
h
e

=λ

ln(1+λh)
x
h
e

,

and hence Fourier sums of continuum functions are readily mapped to umbral Fourier sums faithfully, i.e., involving the same Fourier coefficients multiplying these umbral basis exponentials.[16] 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,\delta (x) \mapsto \frac,and so forth.[17] 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:

All of the above rules apply equally well to any difference operator as to, including and .

\Delta (f g) &= f \,\Delta g + g \,\Delta f + \Delta f \,\Delta g \\[4pt]\nabla (f g) &= f \,\nabla g + g \,\nabla f - \nabla f \,\nabla g\end

\sum_^b \Delta f(n) &= f(b+1)-f(a) \\\sum_^ \nabla f(n) &= f(b)-f(a-1)\end

See references.[18] [19] [20] [21]

Generalizations

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:\beginf_(x,y) &\approx \frac \\f_(x,y) &\approx \frac \\f_(x,y) &\approx \frac \\f_(x,y) &\approx \frac \\f_(x,y) &\approx \frac .\end

Alternatively, for applications in which the computation of is the most costly step, and both first and second derivatives must be computed, a more efficient formula for the last case is f_(x,y) \approx \frac,since the only values to compute that are not already needed for the previous four equations are and .

References

  1. Book: Paul Wilmott. Sam Howison. Jeff Dewynne. The Mathematics of Financial Derivatives: A Student Introduction. 1995. Cambridge University Press. 978-0-521-49789-3. 137. registration.
  2. Book: Peter Olver. Peter J. Olver. Introduction to Partial Differential Equations. 2013. Springer Science & Business Media. 978-3-319-02099-0 . 182.
  3. Book: M Hanif Chaudhry. Open-Channel Flow. 2007 . Springer. 978-0-387-68648-6. 369.
  4. 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)
  5. Web site: Finite differences of polynomials . February 13, 2018 .
  6. Fraser. Duncan C.. On the Graphic Delineation of Interpolation Formulæ . Journal of the Institute of Actuaries. 1 January 1909. 43. 2. 235–241. 10.1017/S002026810002494X . 17 April 2017.
  7. http://commons.wikimedia.org/wiki/File:FDnotes.djvu notes
  8. http://web.media.mit.edu/~crtaylor/calculator.html Finite Difference Coefficients Calculator
  9. [Burkard Polster]
  10. Newton, Isaac, (1687). Principia, Book III, Lemma V, Case 1
  11. Three notes on Ser's and Hasse's representations for the zeta-functions . Iaroslav V. Blagouchine . Integers (Electronic Journal of Combinatorial Number Theory) . 18A . 1–45 . 2018 . 1606.02044.
  12. 10.21468/SciPostPhys.10.1.007 . Newton series expansion of bosonic operator functions . 2021 . König . Jürgen . Hucht . Fred . SciPost Physics . 10 . 1 . 007 . 2008.11139 . 2021ScPP...10....7K . 221293056 . free .
  13. [Robert D. Richtmyer|Richtmeyer, D.]
  14. [George Boole|Boole, George]
  15. Jordan, Charles, (1939/1965). "Calculus of Finite Differences", Chelsea Publishing. On-line: https://books.google.com/books?id=3RfZOsDAyQsC&pg=PA1
  16. Zachos. C.. Cosmas Zachos. 2008. Umbral Deformations on Discrete Space-Time . International Journal of Modern Physics A. 23 . 13. 2005 - 2014 . 10.1142/S0217751X08040548 . 0710.2306. 2008IJMPA..23.2005Z. 16797959.
  17. Curtright . T. L. . Zachos . C. K. . 10.3389/fphy.2013.00015 . Umbral Vade Mecum . Frontiers in Physics . 1 . 2013 . 15 . 1304.0429 . 2013FrP.....1...15C . 14106142 . free .
  18. Book: Levy . H. . Lessman . F. . 1992 . Finite Difference Equations . Dover . 0-486-67260-3.
  19. Book: Ames, W.F. . 1977 . Numerical Methods for Partial Differential Equations . Section 1.6 . Academic Press . New York, NY . 0-12-056760-1.
  20. Book: Hildebrand, F.B. . Francis B. Hildebrand . 1968 . Finite-Difference Equations and Simulations . Section 2.2 . Prentice-Hall . Englewood Cliffs, NJ.
  21. Philippe . Flajolet . Robert . Sedgewick . Robert Sedgewick (computer scientist) . 1995 . Mellin transforms and asymptotics: Finite differences and Rice's integrals . Theoretical Computer Science . 144 . 1–2 . 101–124 . 10.1016/0304-3975(94)00281-M .

External links