When you learned about ordinary differential equations with constant coefficients, an operator D=d/dx was introduced. A corresponding approach may be adopted in the case of finite differences. Of course, you know that differentiation is arrived at by a limiting process applied to differences:
The calculus of finite differences deals with the right hand side of this equation without the limit. One common use of finite differences, known to you, was in linear interpolation. Using tables at school, for example of logarithms or trigonometric functions, you interpolated linearly. The tables were designed so that your result would never be out by more than 0.5 of the last digit.
log 10x
In order to interpolate log 2.036 you wrote
Today, your calculator gives .3087778 = .3088. The shorthand for such a table is
While it is not essential, we will concentrate on uniform difference tables, i.e., when the values of functions are given at regular intervals. Also, it is customary to omit decimal points and forward zeroes, so that the earlier table for logarithms would become
We see that tables can be rough (involve large intervals) when a function changes slowly, and become fine when it changes fast. The first table above shows that the first differences are almost the same. They oscillate between 22 and 21, whence the second difference oscillates in sign. This is the result of round off, an error from the function's point of view. Finite difference tables can be used to discover errors in tabulated functions.
One speaks of noise level which in the first difference can only be 1, since the entries are rounded-off, i.e., the last digit may be incorrect by0.5.
However, such errors build up quickly:
This phenomenon indicates the presence of noise due to round-off in data. An estimate of expected noise level is given by the table:
Like throughout mathematics, notation tends to make life easier, although at first it may appear to be a hurdle.
In the difference table for ln x, the first column corresponded to equi-distant data - values of f(x):
The shift operator E is defined by the relation
where k need not be positive or an integer:
Why should we be concerned with fractional powers of E? We might use this formula to start with only every second value in a table, and later switch over to every value.
In the difference table above, we formed the first differences fj+1-fj , which are now given in terms of the shift operator E by
Similarly,
In this manner, binomial coefficients enter into the finite difference calculus, since
The central difference operator is defined by:
and the backward operator by:
The corresponding Differences Tables are
The values of the forward and backward differences are the same, but they occupy different positions in the tables. The odd order central differences have other values, the even order differences agree with those of the other differences. This aspect of finite differences becomes important for interpolation. In order to interpolate function values at the beginning of a table, forward differences must used, because they have the largest number of differences at the centre of their table; central differences are used inside the table, and backward differences near the end. This becomes obvious when one rewrites tables so that the differences of different orders with the same subscripts are written on one line. Then the front of the forward difference table slants backwards, that of the backward table forward, while the central difference table has triangular form:
We know that we can differentiate a polynomial Pn(x)n times until it becomes a constant. Consequently, by differencing a table of exact values of a polynomial n times, a constant value is obtained:
Proof: Let
and there be given an equidistant table of values fj, j = 1,2,3, , then
Let f(x) = x3 be given by the forward difference table 0(1)5:
This yields a numerical proof of the statement above. Next, let there be given a table 0((0.1)0.5 for the same function:
In this case, the operations have been carried out with entries rounded to two decimals as well with their exact values. It is seen that round-off disturbs the differences which begin to oscillate in sign and grow instead of reaching 0. As a result, we have found a method for testing functions before representing them by polynomials of a finite degree.
Consider the difference table0.1(0.05)0.5 for ex with entries rounded off to 5 decimals:
Note that the third differences are almost the same and the fourth differences oscillate. In fact, by the table above, the expected noise level in the third difference, being approximately +/- 3, it can be said that over the given range a third degree polynomial will approximate within such error limits the exponential function over the range of the table .
Obtain the backward differences for f(x) = x3 for the table 1(.01)1.05 to two decimals chopped.
Note the typical oscillations in sign and growth of the entries! Repeat this calculation rounded to 4 decimals.
As noted above, difference tables permit detection of errors in tabulated as well as in experimental results. The latter, of course, only applies, if the functional relation of the data is known to be continuous.
Let there be given a set of experimental data, believed to fit a quadratic law, and one measurement out of line. A difference table will tell where the error has occurred:
The location of the entry with an error is indicated by an arrow. Of course, the first difference shows already that there is something wrong. The higher differences amplify the error. Hosking calls this spreading effect an error fan. This idea can be pursued by studying the difference table:
The location of an error is obviously centered on 60 in the third difference. Instead of 9214, one should have written 9241. Confirm that this solves the problem!
Given table 1.0(0.1)2.4 for log10x with 4 decimals, detect and correct any errors.
There are suspicious fluctuations in the second and third differences. Those in the third differences alternate in sign and the entires are much larger than the others. One expects to find the pattern
Assume that the entries
From the table of error propagation above, by superposition for two sources of error, one should find
Assume now that the third differences are approximately constant, whence
The result of this adjustment is shown in the next third difference column. Repeating the argument for the second error, using the corrected entries, we find:
We can now obtain corrected values by solving the equations:
The last column of third differences presents a great improvement on the initial third differences.
Look now at another approach to interpolation. Say, one has measured a physical parameter y = f(x) at four points at arbitrary distances between the independent variable x. One looks at the results and guesses that it should vary according to a quadratic law. It is then decided to interpolate quadratically at a convenient value and confirm experimentally that the measured and predicted values agree within an admissible noise level in the second differences.
Consider first the linear case. Let the function vary slowly and fit straight lines between adjacent points, i.e., use linear interpolation:
By the figure, in which the points (xj,f(xj),(xj+1,f(xj+1) are linked by a straight line rather than the actual curved function, we find for the points along the straight line:
From the 0.90(0.01)0.99 table for e-x find the value of the function for x = 0.934.
Hence f(0.934) = 0.3946 + 4*(-0.0040)/10 = 0.3930.
Naturally, this is the same procedure which was mentioned earlier, but it has now been formally developed.
Next, take a look at quadratic interpolation, when three points are used: xj, xj+1=xj+h,xj+2=xj+2h. Consider the polynomial:
and choose a, b, c so that
The quadratic interpolation formula is now obtained by setting
Note the second difference term and the similarity to the second order term in the Taylor expansion!
Using the earlier table for f(x)= e-x, improve the value of f(0.934), given by linear interpolation:
The correction 0.0024/200 is seen to be negligible.
Given the table 0(0.1)0.5 for cosh x, find the value of cosh 0.25:
By linear interpolation: cosh 0.25 = 1.020 + 0.0250.05/0.1 = 1.0325, because
By quadratic interpolation, cosh(0.25) = 1.020 + 0.013 + 0.5(0.5 - 1)0.01/2 = = 1.020 + 0.0125 - 0.00125 = 1.03125; your calculator gives 1.031413..