[3]: There exists ξ that satisfies the following.f’(ξ)=f[x0,x1]
[4]: There exists ξ that satisfies the following.n!1f(n)(ξ)=f[x0,⋯,xn]
[3]’: f[xi,xi]=f′(xi)
[4]’: f[n+1xi,⋯,xi]=n!1f(n)(xi)
H{a,b,c,⋯} denotes the smallest interval that includes a,b,c,⋯.
Explanation
Divided differences greatly save space when expressing various theories of numerical analysis.
Theorem [2] is especially useful in actual calculations,
since it is expressed as f[x0,x1,x2]=(x0−x1)(x0−x2)f(x0)+(x1−x2)(x1−x0)f(x1)+(x2−x0)(x2−x1)f(x2),
allowing for iterative calculations to be simplified compared to the original definition.
[3] is essentially Mean Value Theorem, and if you have ever considered the concept of ‘instantaneous rate of change’ when differentiating, this will help you understand why divided differences can replace differentiation and why it’s called Divided Difference. Theorem [4] can be generalized in this manner. The proof can be thought of as the variables of divided differences becoming infinitely close, or taking a limit, which can be seen in [3]’, [4]’ as derivatives of degree n. Such a conceptual approach overcomes the limitations arising from the definition of divided differences and enriches the theory of numerical analysis.
Example
Let’s calculate some divided differences for f(x):=x2+1 simply.
For one point,
f[3]=f(3)=10
For two points,
f[0,5]=0−5f(0)−f(5)=−51−26=5
For three points,
f[2,3,−1]====2−(−1)2−3f(2)−f(3)−3−(−1)f(3)−f(−1)3−15−10−410−235−21
Divided differences can obviously be calculated for a finite vector, but usually, most applications go up to n=2, and beyond that, it’s rarely used.
Implementation
Here is an implementation of divided differences in R code, which takes a functionf and a vector x=(x0,⋯,xn) to return f[x0,⋯,xn].
Ψn(x):=(x−x0)⋯(x−xn)
Differentiating Ψn with respect to x and substituting x=xj gives
Ψ’n(xj):=(x−x0)⋯(x−xj−1)(x−xj+1)⋯(x−xn)
⟹(x−xj)Ψ’n(xj)Ψ(x)n≡(xj−x0)⋯(xj−xj−1)(xj−xj+1)⋯(xj−xn)(x−x0)⋯(x−xj−1)(x−xj+1)⋯(x−xn)=lj(x)
According to Lagrange’s formula, the polynomial interpolation of f is
pn(x)=j=0∑n(x−xj)Ψ’n(xj)Ψn(x)⋅f(xj)
Therefore, since the coefficient of the highest order term of pn is j=0∑nΨ’n(xj)f(xj), and in Newton’s divided difference formula, the coefficient of the highest order term of pn is f[x0,⋯,xn],
f[x0,⋯,xn]=i=0∑nj∈{0,⋯,n}∖{i}∏(xi−xj)f(xi)
■
[1]
By Theorem [2], changing the order within [x0,⋯,xn] is just changing the order of addition when calculating i=0∑nj∈{0,⋯,n}∖{i}∏(xi−xj)f(xi), so it’s always the same.
If we say pn(x)=pn−1(x)+C(x), then degC=n and for i=0,⋯,(n−1), pn(xi)=f(xi)=pn−1(xi), so for some constant an=0 we have C(x)=an(x−x0)⋯(x−xn−1). Substituting C(x) with x=xn gives
C(xn)=pn(xn)−pn−1(xn)
C(xn)=an(xn−x0)⋯(xn−xn)
Since pn is the polynomial interpolation of f, it becomes pn(xn)=f(xn),
an(xn−x0)⋯(xn−xn−1)=f(xn)−pn−1(xn)