One thing depends on another: a common and easily understood concept. If a train leaves Bristol early in the morning, and arrives in London early in the evening, its location depends upon time of day; we might guess that it would be in Swindon around lunchtime, as Swindon is round about midway between Bristol and London. This estimate is a crude example of the mathematical process known as interpolation.
Interpolation is the determination of an intermediate value of a function, from a number^{1} of adjacent values, such as the determination of the location of a train using its position at earlier and later times. Interpolation can be performed with quite high accuracy in suitable circumstances, and we shall create an interpolation method using only basic mathematical concepts and a minimum of formulae, by an intuitive process.
A key feature of interpolation is that intermediate values of a function can be determined without knowledge of the precise nature of the function. The technique is applicable to tabulated data values in a considerable number of cases, and is most useful for this reason^{2}.
Mathematical Concepts
We shall make frequent use of the concept of a function, which in turn involves the concept of variables, but neither concept is complicated^{3}.
A variable represents a quantity which may have a variety of values, but a specific value in a specific instance. A variable is a convenient notation for any or all such instances.
A function encapsulates the idea that one quantity depends upon another. A function provides the value of a dependent variable which is related to another, independent variable. A function may be expressed as a formula, or merely a table of values.
These concepts, and simple arithmetic, are almost all that are required to perform interpolation. The fact that a product of factors is zero whenever any one of the factors is zero, and is one when every factor is one, is also used.
Smooth Variation
There is often a smooth variation of a dependent variable as an independent variable changes. If the train we mentioned above stopped at any stations on its way, its progress would not be smooth. But when variation is smooth, we can expect to perform accurate interpolation. We will now forget the train, and as an ongoing example use the decay of a radioactive substance, having a radiation intensity which is initially 16 but which halves each day. The intensity is also divided by √2 every half day, and so on, as tabulated below.
Day  0  0.5  1  2  3  3.5  4  Intensity  16  11.31371_{}  8  4  2  1.41421_{+}  1 
 The values for days 0.5 and 3.5 are intended to be typical examples of values which might be unknown unless produced by interpolation, for instance if the intensity is only measured daily. 

The radioactive intensity r after d days is given the formula r = 16 x 2^{–d}, but this formula can be difficult to evaluate, and might even be unknown^{4}, but we do know the intensity varies smoothly as time elapses.
Linear Interpolation
The simplest interpolation method is known as linear interpolation, as it is based on a straight line approximation. This approximation is obtained by assuming that the total change over an interval is produced by a constant rate of change, and using this rate of change pro–rata to find intermediate values. For this reason, the method is also known as interpolation by proportional parts.
Using our example values and focussing on days 0 and 4, the intensity falls from 16 to 1 over 4 days, a rate of change of –3.75 per day. Alternatively, referring to days 0 and 2, the average rate of change is –6 per day, as then the intensity falls from 16 to 4 over 2 days. These approximations obviously differ, and the interpolation results obtained from both of them are tabulated below.
Interpolation based on Days 0 and 4 Day  Approximation  Intensity  Error  0  16  16  0  0.5  14.125  11.31371  +2.81129  1  12.25  8  +4.25  2  8.5  4  +4.5  3  4.75  2  +2.75  3.5  2.875  1.41421  +1.46079  4  1  1  0   Interpolation based on Days 0 and 2 Day  Approximation  Intensity  Error  0  16  16  0  0.5  13  11.31371  +1.68629  1  10  8  +2  2  4  4  0  3  –2  2  –4  3.5  –5  1.41421  –6.41421  4  –8  1  –9  
In both cases the results are inaccurate, but do demonstrate several features of interpolation in general^{5}.
Intermediate values obtained by interpolation over a short interval are usually more accurate than those obtained from use of a larger interval. (The values for days 0.5 and 1 are more accurate when based on days 0 and 2 than when based on days 0 and 4.)
The intermediate values closest to the values upon which the interpolation is based tend to be more accurate. (When based upon days 0 and 4, the value for day 0.5 is more accurate than the value for day 1, and the value for day 3.5 is more accurate than the value for day 3.)
The error increases rapidly outside the interval upon which the interpolation is based, and such values are strictly speaking obtained by extrapolation. (The values for days 3, 3.5 and 4 based on days 0 and 2 are grossly inaccurate.)
Weight Functions
Linear interpolation can be performed another way, which is slightly less direct, but gives an insight which may be helpful when more advanced interpolation methods are considered. Instead of working with average rate of change, we instead choose two weight functions, specifically designed to facilitate the interpolation. We shall show how this is done by reworking the interpolation based on days 0 and 2.
The linear function with the value 1 on day 0 and 0 on day 2, will be denoted by L_{0} = 1 – d / 2. and the linear function with the value 0 on day 0 and 1 on day 2, will be denoted by L_{2} = d / 2. Remembering that L_{0} and L_{2} are both functions, note that the sum aL_{0} + bL_{2} gives the value a on day 0, and b on day 2, because L_{2} is 0 on day 0 and L_{0} is 0 on day 2. To obtain the required values for days 0 and 2, we need to choose a = 16 and b = 4. The detailed calculations are tabulated below.
Weighted Interpolation based on Days 0 and 2 Day d  L_{0}  L_{2}  16L_{0}  4L_{2}  Approximation  Intensity  Error 
0  1  0  16  0  16  16  0 
0.5  0.75  0.25  12  1  13  11.31371  +1.68629 
1  0.5  0.5  8  2  10  8  +2 
2  0  1  0  4  4  4  0 
3  –0.5  1.5  –8  6  –2  2  –4 
3.5  –0.75  1.75  –12  7  –5  1.41421  –6.41421 
4  –1  2  –16  8  –8  1  –9 
Thus, using linear weight functions, we have recreated the interpolated values obtained by the direct method.
More Complicated Weight Functions
Postponing their derivation momentarily, we will now use the weight functions Q_{0} = ( d^{2} – 6d + 8 ) / 8, Q_{2} = ( –d^{2} + 4d ) / 4 and Q_{4} = ( d^{2} – 2d ) / 8, forming the sum 16Q_{0} + 4Q_{2} + Q_{4} to obtain approximations based on days 0, 2 and 4. The approximations obtained are tabulated below.
Weighted Interpolation based on days 0, 2 and 4 Day d  Q_{0}  Q_{2}  Q_{4}  16Q_{0}  4Q_{2}  Approximation  Intensity  Error 
0  1  0  0  16  0  16  16  0 
0.5  0.65625  0.4375  –0.09375  10.5  1.75  12.15625  11.31371  +0.84254 
1  0.375  0.75  –0.125  6  3  8.875  8  +0.875 
2  0  1  0  0  4  4  4  0 
3  –0.125  0.75  0.375  –2  3  1.375  2  –0.625 
3.5  –0.09375  0.4375  0.65625  –1.5  1.75  0.90625  1.41421  –0.50796 
4  0  0  1  0  0  1  1  0 
This example (hopefully) clarifies the role of the weight functions. For each point of interest, there is a weight function which has the value 1 there, and has the value 0 at all the other points of interest. A suitable multiple of the weight function gives the approximation its intended value at that point, independently of the others, so that as each chosen multiple of a weight function is added, one more function value is faithfully reproduced. When all the weight functions have been used in this way, the resulting approximation is a smooth function^{6} which is exact at every point of interest.
This more elaborate interpolation, based on three points, has resulted in a considerable reduction in the error at intermediate points. A critical review of the results indicates some anomalies however. Although the errors are lower than either of the linear approximations previously found, the new approximation suggests that the intensity is rising by day 4, since a lower value is given at day 3.5, a behaviour which contradicts physical reality. It is also embarrassing that this more elaborate method gives WORSE approximation than simple linear interpolation over the range 2 to 4 days^{7}. This example does demonstrate further features of interpolation in general, though.
The error typically changes sign when passing through one of the points on which the interpolation is based (in this case, the error is positive before day 2, and negative afterward).
Nonlinear interpolation, that is interpolation based on more than two points, may lead to approximations with oscillatory behaviour (in this case, the rising approximations approaching day 4 are evidence of this).
The accuracy is not necessarily improved by taking account of values outside of an interval, particularly if large changes occur outside the interval (here, the linear approximation over days 2 to 4 is not improved by taking account of the value at day 0, although the linear approximation over days 0 to 2 is improved by taking account of the value at day 4).
Although there are many potential dangers when nonlinear interpolation is attempted, it is still used, normally over ranges in which the interpolated function exhibits far less variation than our example. We did not expect a straight line to adequately approximate so severe a curve, and to an extent the problems we have noted arise because we are expecting too much of a simple quadratic curve. We will show this with one more example, but first the derivation of weight functions is described
Building Weight Functions
We have described the use of weight functions, indirectly specifying the properties these functions require. To describe how these functions are constructed, we need a good notation^{8}, so that we can refer to a number of different points and a number of different functions in a systematic fashion.
The goal is to interpolate some function so that at n + 1 given different points denoted by x_{0}, x_{1} … x_{n}, we obtain the corresponding function values f_{0}, f_{1} … f_{n} exactly. These points are usually known as collocation points. It is more convenient to number the collocation points from 0 to n and count them as n + 1 points, because this will result in products of n factors (and polynomials of n^{th} degree). We need to construct a weight function associated with each point in turn, so let's call the weight function W_{i} when it's associated with the point x_{i}. We will write W_{i} (x) to emphasise that W_{i} is a function of x. Although it would be more correct to write W_{i} (x,x_{0},x_{1} … x_{n}), this cumbersome form will not be used, because in any particular case it is convenient to think of the collocation points as given constants.
If x_{j} is one of the collocation points, then x_{i} is another collocation point provided i ≠ j. The simple linear term [ x – x_{j} ] is zero if x = x_{j}, and nonzero if x ≠ x_{j}. The modifed linear term [ x – x_{j} ] / [ x_{i} – x_{j} ] in which only x is variable, is 0 when x = x_{j}, but when i ≠ j and x = x_{i} it has the value 1. There are n such terms for each x_{i}, one for each of the other collocation points, and we may form their product. When x = x_{i}, all such factors will have the value 1, and so will the product. When any factor is zero, the product will be zero, and thus for any x = x_{j} if j ≠ i. This is precisely what we require for W_{i}, which, being a product of n linear terms, will be a polynomial of n^{th} degree.
In the preceding examples of interpolation using weight functions, we have given a formula for each one. Now we will find the cubic weight functions for the collocation points 0, 1, 2 and 3, for use in a final example.
W_{0} (x) = { [ x – 1 ] / [ 0 – 1 ] } { [ x – 2 ] / [ 0 – 2 ] } { [ x – 3 ] / [ 0 – 3 ] } = –[ x^{3} – 6x^{2} + 11x – 6 ] / 6
W_{1} (x) = { [ x – 0 ] / [ 1 – 0 ] } { [ x – 2 ] / [ 1 – 2 ] } { [ x – 3 ] / [ 1 – 3 ] } = [ x^{3} – 5x^{2} + 6x ] / 2
W_{2} (x) = { [ x – 0 ] / [ 2 – 0 ] } { [ x – 1 ] / [ 2 – 1 ] } { [ x – 3 ] / [ 2 – 3 ] } = –[ x^{3} – 4x^{2} + 3x ] / 2
W_{3} (x) = { [ x – 0 ] / [ 3 – 0 ] } { [ x – 1 ] / [ 3 – 1 ] } { [ x – 2 ] / [ 3 – 2 ] } = [ x^{3} – 3x^{2} + 2x ] / 6
For interpolation alone, it is not really necessary to derive these formulae, and in fact the final example was created by a spread sheet, without using the algebraic forms of the weight functions.
Final Interpolation Example
The above formulae for the collocation points 0, 1, 2 and 3 are applied to our radioactive decay example. The tabulated results contain more intermediate values than given before, which unfortunately makes the table rather long. It shows we have at last obtained reasonably accurate interpolation, and gives some indication of how the error varies between collocation points.
Interpolation based on Days 0, 1, 2 and 3 Day  W_{0}  W_{1}  W_{2}  W_{3}  16W_{0}  8W_{1}  4W_{2}  2W_{3}  Approx  Intensity  Error 
0  1  0  0  0  16  0  0  0  16  16  0 
0.1  0.8265  0.2755  –0.1305  0.0285  13.224  2.204  –0.522  0.057  14.963  14.92853  +0.03447 
0.2  0.672  0.504  –0.224  0.048  10.752  4.032  –0.896  0.096  13.984  13.92881  +0.05519 
0.3  0.5355  0.6885  –0.2835  0.0595  8.568  5.508  –1.134  0.119  13.061  12.99604  +0.06496 
0.4  0.416  0.832  –0.312  0.064  6.656  6.656  –1.248  0.128  12.192  12.12573  +0.06627 
0.5  0.3125  0.9375  –0.3125  0.0625  5  7.5  –1.25  0.125  11.375  11.31371  +0.06129 
0.6  0.224  1.008  –0.288  0.056  3.584  8.064  –1.152  0.112  10.608  10.55606  +0.05194 
0.7  0.1495  1.0465  –0.2415  0.0455  2.392  8.372  –0.966  0.091  9.889  9.84916  +0.03984 
0.8  0.088  1.056  –0.176  0.032  1.408  8.448  –0.704  0.064  9.216  9.18959  +0.02641 
0.9  0.0385  1.0395  –0.0945  0.0165  0.616  8.316  –0.378  0.033  8.587  8.57419  +0.01281 
1  0  1  0  0  0  8  0  0  8  8  0 
1.1  –0.0285  0.9405  0.1045  –0.0165  –0.456  7.524  0.418  –0.033  7.524  7.46426  –0.01126 
1.2  –0.048  0.864  0.216  –0.032  –0.768  6.912  0.864  –0.064  6.944  6.9644  –0.0204 
1.3  –0.0595  0.7735  0.3315  –0.0455  –0.952  6.188  1.326  –0.091  6.471  6.49802  –0.02702 
1.4  –0.064  0.672  0.448  –0.056  –1.024  5.376  1.792  –0.112  6.032  6.06287  –0.03087 
1.5  –0.0625  0.5625  0.5625  –0.0625  –1  4.5  2.25  –0.125  5.625  5.65685  –0.03185 
1.6  –0.056  0.448  0.672  –0.064  –0.896  3.584  2.688  –0.128  5.248  5.27803  –0.03003 
1.7  –0.0455  0.3315  0.7735  –0.0595  –0.728  2.652  3.094  –0.119  4.899  4.92458  –0.02558 
1.8  –0.032  0.216  0.864  –0.048  –0.512  1.728  3.456  –0.096  4.576  4.59479  –0.01879 
1.9  –0.0165  0.1045  0.9405  –0.0285  –0.264  0.836  3.762  –0.057  4.277  4.28709  –0.01009 
2  0  0  1  0  0  0  4  0  4  4  0 
2.1  0.0165  –0.0945  1.0395  0.0385  0.264  –0.756  4.158  0.077  3.743  3.73213  +0.01087 
2.2  0.032  –0.176  1.056  0.088  0.512  –1.408  4.224  0.176  3.504  3.4822  +0.0218 
2.3  0.0455  –0.2415  1.0465  0.1495  0.728  –1.932  4.186  0.299  3.281  3.24901  +0.03199 
2.4  0.056  –0.288  1.008  0.224  0.896  –2.304  4.032  0.448  3.072  3.03143  +0.04057 
2.5  0.0625  –0.3125  0.9375  0.3125  1  –2.5  3.75  0.625  2.875  2.82843  +0.04657 
2.6  0.064  –0.312  0.832  0.416  1.024  –2.496  3.328  0.832  2.688  2.63902  +0.04898 
2.7  0.0595  –0.2835  0.6885  0.5355  0.952  –2.268  2.754  1.071  2.509  2.46229  +0.04671 
2.8  0.048  –0.224  0.504  0.672  0.768  –1.792  2.016  1.344  2.336  2.2974  +0.0386 
2.9  0.0295  –0.1305  0.2755  0.8265  0.456  –1.044  1.102  1.653  2.167  2.14355  +0.02345 
3  0  0  0  1  0  0  0  2  2  2  0 
3.1  –0.0385  0.1705  –0.3255  1.1935  –0.616  1.364  –1.302  2.387  1.833  1.86607  –0.03307 
3.2  –0.088  0.384  –0.704  1.408  –1.408  3.072  –2.816  2.816  1.664  1.7411  –0.07710 
3.3  –0.1495  0.6435  –1.1385  1.6445  –2.392  5.148  –4.554  3.289  1.491  1.6245  –0.1335 
3.4  –0.224  0.952  –1.632  1.904  –3.584  7.616  –6.528  3.808  1.312  1.51572  –0.20372 
3.5  –0.3125  1.3125  –2.1875  2.1875  –5  10.5  –8.75  4.375  1.125  1.41421  –0.28921 
3.6  –0.416  1.728  –2.808  2.496  –6.656  13.824  –11.23  4.992  0.928  1.31951  –0.39151 
3.7  –0.5355  2.2015  –3.4965  2.8305  –8.568  17.612  –13.99  5.661  0.719  1.23114  –0.51214 
3.8  –0.672  2.736  –4.256  3.192  –10.75  21.888  –17.02  6.384  0.496  1.1487  –0.6527 
3.9  –0.8265  3.3345  –5.0895  3.5815  –13.22  26.676  –20.36  7.163  0.257  1.07177  –0.81477 
4  –1  4  –6  4  –16  32  –24  8  0  1  –1 
The interpolation produced in this case is much more successful. The oscillatory behaviour has gone, and the approximations are now much more accurate than before. Notice, however, that the accuracy is reasonable only within the range of the collocation points  the error grows rapidly outside that range, so that extrapolation is still a risky business.
Practical Considerations
It must be emphasised that this method of interpolation should only be used when the approximated function is known to be smooth, and when the function values at the collocation points are known to be accurate. The following points should be borne in mind.
 The function to be interpolated must be smooth. Interpolation by this method should not be attempted near an exceptional value (for example, to interpolate a table of reciprocals near the origin).
It cannot increase the accuracy beyond that of the tabulated values.
It is unsuitable if the base data is influenced by statistical variation, and will tend to amplify 'noise' if used.
It has been mentioned that the interpolation can be performed by a spreadsheet program. The following tips are offered for such an implementation.
Generate the weight functions individually. The zero and one values that these must have at the collocation points provide an easy and useful check.
Little purpose is served by tabulating the individual multiples of the weight functions. The reproduction of table values at the collocation points furnishes an easy check of the sum of multiples of the weight functions.
It is relatively easy to interpolate given data in more than one way, so that approximations can be compared for the purpose of error estimation (for example, cubic interpolation using collocation points 0, 1, 2 and 3 could be compared with cubic interpolation using collocation points 1, 2, 3 and 4, or quartic interpolation based on 0, 1, 2, 3 and 4).
Summary
The interpolation method developed here is the foundation of many techniques of numerical mathematics. In fact, it is a simple interpretation of the famous Lagrange Interpolation formula. A major factor in its widespread use is its generality; it can be used with functions of unknown form, tabulated at irregular intervals, and is relatively easy to compute.
Using everhigher orders of interpolation formula can be compared with using ever greater numbers of terms in an infinite series. A series is usually developed in the vicinity of a point, whereas interpolation immediately applies to a definite range, and approximates over the whole of that range.
The exposition above has concentrated on finding intermediate values. Instead, the focus could have been on finding the coefficients of the polynomials. Simple transformations of these coefficients would then enable either derivatives or integrals to be approximated.
There are other methods of interpolation, notably those based on the trigonometric functions, which are closely related to Fourier series. There are even other methods of polynomial interpolation, based on leastsquare curve fitting, or families of orthogonal polynomials. The method given here can be expressed in a variety of forms of equivalent forms, producing exactly the same results but organising the calculations very differently.