# Lagrange's interpolation formula.

In issue 31(2) of the Australian Senior Mathematics Journal, Kok (2017) describes a useful four-step process for investigating number patterns and identifying the underlying function. The process is demonstrated for both linear and quadratic functions.

With respect to the quadratic example, I provide an additional idea relevant to step 3 and demonstrate the use of Lagrange's interpolation formula as an alternative method for completing step 4.

Example 2 in Kok's article is:

Find the general term in the following number pattern. 1, 3, 6, 10, 15, ...

Kok's four-step process starts by identifying input and output values, giving the following table.
```x   1   2   3   4    5

y   1   3   6   10   15
```

We view these as points on some curve. In problems of this type we traditionally assume that there is a relatively simple solution to find. That is, we ignore the fact that there are infinitely many polynomials of degree 5 that pass through these 5 points, and that each such polynomial continues the pattern differently.

Step 3. Verifying that the unknown function is quadratic

In the third step of the four-step process, Kok takes the differences of successive y-values and finds they give the linear sequence 2, 3, 4, 5. Taking the difference of the terms in that linear sequence gives a constant increase of 1. Kok concludes that the function must be quadratic, since the first derivative of a quadratic function is linear and the second derivative is constant.

While the conclusion feels plausible, it is arguably not complete, since taking differences of successive terms is not identical to taking derivatives. When we took differences, the x-values were increasing by 1. In a derivative, we have let the differences in x-values approach zero. To complete the proof we want to demonstrate that the second differences of a quadratic function are constant.

The techniques being used here come from a branch of mathematics known as finite differences. The tables in Kok's article showing the incremental changes in the y-values can be called difference tables. The forward difference operator is denoted by [DELTA]. The first difference of a function f(x) is:

[DELTA]f(x) = f(x + 1) - f(x)

Technically we should say that we are using an interval of differencing of 1 here, which is all we need for the task at hand, but there is also a more general formula that involves an interval of differencing of h.

Consider the general quadratic function f(x) = a[x.sup.2] + bx + c.

The first difference of this function is

[DELTA]f(x) = f(x +1) - f(x) = {a [(x + 1).sup.2] + b (x +1) + c} - {a[x.sup.2] + bx + c } = 2ax + a + b

The second difference is

[[DELTA].sup.2]f(x) = [DELTA]f(x + 1) - [DELTA]f(x) = {2a (x +1) + a + b} - {2ax + a + b} = 2a

That is, the first difference is a linear function and the second difference is a constant. Thus when we encounter linear first differences and constant second differences, as in Kok's Example 2, it is safe to conclude we are dealing with a quadratic function.

We are now convinced the unknown function is quadratic. Step 4 is to find what that quadratic function is. Kok demonstrates four different interesting methods to achieve this. Yet another method for completing step 4 is to use Lagrange's interpolation formula.

Historical background

Lagrange's interpolation formula is also known as Lagrange's interpolating polynomial. Archer (2018) suggests it was published by Waring prior to Lagrange. It was originally used to interpolate an unknown value of a smooth function, given n known values, by assuming that the function could be approximated by a polynomial of degree n - 1. If the function is definitely known to be a polynomial of that degree, then the result is exact rather than an estimate.

Freeman (1960) notes that "Lagrange's formula is usually laborious to apply in practice" and recommends instead using other finite difference interpolation formulae. Finite difference techniques were developed to allow efficient interpolation when the only technology available was pencil, paper and logarithm tables. There is much clever and pretty mathematics involved in finite differences, most of which has been rendered obsolete by computers. Faced with the same task today, high school students could easily implement Lagrange's Interpolation Formula in a spreadsheet.

However, while most finite difference techniques are obsolete, difference tables are still a clever and fast way to detect whether a number sequence is polynomial in nature, as Kok clearly demonstrates in Step 3 of his examples.

There are finite difference techniques, such as Newton's advancing difference formula, that use more data from the difference table to ascertain the quadratic function, but alas they require more time to master and employ some tertiary level mathematics. By contrast, Lagrange's formula can be explained in minutes using only high school mathematics, and requires only the coordinates of points.

Proving the quadratic form of Lagrange's formula

While Lagrange's interpolation formula can be stated for a general case involving n points and a polynomial of degree n - 1, it is more easily understood by looking at a particular case.

When n = 3, it states that the quadratic polynomial passing through the three points ([x.sub.1], [y.sub.1]), ([x.sub.2], [y.sub.2]) and ([x.sub.3], [y.sub.3]) is

[mathematical expression not reproducible]

To prove that this is true, first note that each of the three terms on the right hand side is a quadratic in x, and so the right hand side, being the sum of these three terms, is a polynomial of degree at most 2. (If we accidentally apply the quadratic form of Lagrange's interpolation formula to three collinear points, the right hand side will gracefully collapse to a linear function.)

The general quadratic f(x) = a[x.sup.2] + bx + c has three parameters, so three points are sufficient to uniquely determine a particular quadratic function of x. Hence to complete the proof we just need to verify that the three points ([x.sub.1], [y.sub.1]), ([x.sub.2], [y.sub.2]) and ([x.sub.3], [y.sub.3]) do all satisfy Lagrange's formula.

At the point ([x.sub.1], [y.sub.1]), Lagrange's formula states:

[mathematical expression not reproducible]

as required. A similar process works for the other two points.

Whichever point you verify, two of the terms on the right hand side clearly collapse to zero and the other term provides the required y-value. If you appreciate that pattern, it is straightforward to extend Lagrange's formula to find a cubic polynomial passing through four given points, or any higher order scenario you require.

The example

Kok considered the quadratic function passing through the five points (1, 1), (2, 3), (3, 6), (4, 10) and (5, 15). Using the first three points, Lagrange's Formula gives

[mathematical expression not reproducible]

This matches Kok's result.

Lagrange's Formula does not require that the three x-values be evenly spaced, so students can be asked to pick any three of the five points and verify that they can reach the same answer.

The linear form

The linear form of Lagrange's interpolation formula states that the linear polynomial passing through the two points ([x.sub.1], [y.sub.1]) and ([x.sub.2], [y.sub.2]) is

f(x) = x-[x.sub.2]/[x.sub.1]-[x.sub.2] [y.sub.1] + x-[x.sub.1]/[x.sub.2]-[x.sub.1] [y.sub.2]

This can be used to verify the linear example in Kok's paper.

High school students will also learn another way to find the formula of a line passing through these two points. If (x, y), ([x.sub.1], [y.sub.1]) and ([x.sub.2], [y.sub.2]) are collinear, the gradients between any two of the three points are equal, so:

y-[y.sub.1]/x-[x.sub.1] = [y.sub.2]-[y.sub.1]/[x.sub.2]-[x.sub.1]

A nice algebraic challenge for students is to derive Lagrange's formula for the linear case from this result.

Australian Curriculum

Unit 1 of the mathematical methods syllabus includes a review of quadratic relationships. This refers to being able to "find the equation of a quadratic given sufficient information (ACMMM009)". Sufficient information could conceivably include being given any three points ([x.sub.1], [y.sub.1]), ([x.sub.2], [y.sub.2]) and ([x.sub.3], [y.sub.3]). Note that Lagrange's formula does not require [x.sub.1], [x.sub.2] and [x.sub.3] to be evenly spaced, so it is a very general result, and arguably the most efficient solution to such a problem.

References

Archer, B. & Weisstein & E. W. Lagrange (2018). Langrange interpolating polynomial. Retrieved 21January 2018 from http://mathworld.wolfram.com/LagrangeInterpolatingPolynomial. html

Freeman, H. (1960). Finite differences for actuarial students. Cambridge: Cambridge University Press.

Kok, X. K. (2017). Using linear and quadratic functions to teach number patterns in secondary school. Australian Senior Mathematics Journal, 31(2), 42-52.

Jim Farmer

Macquarie University, NSW
COPYRIGHT 2018 The Australian Association of Mathematics Teachers, Inc.
No portion of this article can be reproduced without the express written permission from the copyright holder.