Lagrange polynomial


In numerical analysis, Lagrange polynomials are used for polynomial interpolation. For a given set of points with no two values equal, the Lagrange polynomial is the polynomial of lowest degree that assumes at each value the corresponding value, so that the functions coincide at each point.
Although named after Joseph-Louis Lagrange, who published it in 1795, the method was first discovered in 1779 by Edward Waring It is also an easy consequence of a formula published in 1783 by Leonhard Euler.
Uses of Lagrange polynomials include the Newton–Cotes method of numerical integration and Shamir's secret sharing scheme in cryptography.
Lagrange interpolation is susceptible to Runge's phenomenon of large oscillation. As changing the points requires recalculating the entire interpolant, it is often easier to use Newton polynomials instead.

Definition

Given a set of k + 1 data points
where no two are the same, the interpolation polynomial in the Lagrange form is a linear combination
of Lagrange basis polynomials
where. Note how, given the initial assumption that no two are the same, then , so this expression is always well-defined. The reason pairs with are not allowed is that no interpolation function such that would exist; a function can only get one value for each argument. On the other hand, if also, then those two points would actually be one single point.
For all, includes the term in the numerator, so the whole product will be zero at :
On the other hand,
In other words, all basis polynomials are zero at, except, for which it holds that, because it lacks the term.
It follows that, so at each point,, showing that interpolates the function exactly.

Proof

The function being sought is a polynomial in of the least degree that interpolates the given data set; that is, it assumes the value at the corresponding for all data points :
Observe that:
Expand this product. Since the product omits the term where, if then all terms that appear are. Also, if then one term in the product will be,, zeroing the entire product. So,
where is the Kronecker delta. So:
Thus the function is a polynomial with degree at most and where.
Additionally, the interpolating polynomial is unique, as shown by the unisolvence theorem at the polynomial interpolation article.

A perspective from linear algebra

Solving an interpolation problem leads to a problem in linear algebra amounting to inversion of a matrix. Using a standard monomial basis for our interpolation polynomial, we must invert the Vandermonde matrix to solve for the coefficients of. By choosing a better basis, the Lagrange basis, , we merely get the identity matrix, Kronecker delta|, which is its own inverse: the Lagrange basis automatically inverts the analog of the Vandermonde matrix.
This construction is analogous to the Chinese Remainder Theorem. Instead of checking for remainders of integers modulo prime numbers, we are checking for remainders of polynomials when divided by linears.
Furthermore, when the order is large, Fast Fourier Transformation can be used to solve for the coefficients of the interpolated polynomial.

Examples

Example 1

We wish to interpolate ƒ = x2 over the range 1 ≤ x ≤ 3, given these three points:
The interpolating polynomial is:

Example 2

We wish to interpolate ƒ = x3 over the range 1 ≤ x ≤ 4, given these four points:
The interpolating polynomial is:

Barycentric form

Using
we can rewrite the Lagrange basis polynomials as
or, by defining the barycentric weights
we can simply write
which is commonly referred to as the first form of the barycentric interpolation formula.
The advantage of this representation is that the interpolation polynomial may now be evaluated as
which, if the weights have been pre-computed, requires only operations as opposed to for evaluating the Lagrange basis polynomials individually.
The barycentric interpolation formula can also easily be updated to incorporate a new node by dividing each of the, by and constructing the new as above.
We can further simplify the first form by first considering the barycentric interpolation of the constant function :
Dividing by does not modify the interpolation, yet yields
which is referred to as the second form or true form of the barycentric interpolation formula. This second form has the advantage that need not be evaluated for each evaluation of.

Remainder in Lagrange interpolation formula

When interpolating a given function f by a polynomial of degree at the nodes we get the remainder which can be expressed as
where is the notation for divided differences. Alternatively, the remainder can be expressed as a contour integral in complex domain as
The remainder can be bound as

Derivation

Clearly, is zero at nodes. To find at a point. Define a new function and choose where is the constant we are required to determine for a given. Now has zeroes between and . Assuming that is -times differentiable, and are polynomials, and therefore, are infinitely differentiable. By Rolle's theorem, has zeroes, has zeroes... has 1 zero, say. Explicitly writing :
The equation can be rearranged as

Derivatives

The th derivatives of the Lagrange polynomial can be written as
For the first derivative, the coefficients are given by
and for the second derivative
Through recursion, one can compute formulas for higher derivatives.

Finite fields

The Lagrange polynomial can also be computed in finite fields. This has applications in cryptography, such as in Shamir's Secret Sharing scheme.