Lagrange polynomial

In numerical analysis, the Lagrange interpolating polynomial is the unique polynomial of lowest degree that interpolates a given set of data.

Although named after Joseph-Louis Lagrange, who published it in 1795,[1] the method was first discovered in 1779 by Edward Waring.

[2] It is also an easy consequence of a formula published in 1783 by Leonhard Euler.

[3] Uses of Lagrange polynomials include the Newton–Cotes method of numerical integration, Shamir's secret sharing scheme in cryptography, and Reed–Solomon error correction in coding theory.

For equispaced nodes, Lagrange interpolation is susceptible to Runge's phenomenon of large oscillation.

The Lagrange interpolating polynomial for those nodes through the corresponding values

common to every basis polynomial, a node-specific constant

(called the barycentric weight), and a part representing the displacement from

out from the sum, we can write the Lagrange polynomial in the so-called first barycentric form: If the weights

The barycentric interpolation formula can also easily be updated to incorporate a new node

This second form has advantages in computation cost and accuracy: it avoids evaluation of

, catastrophic cancelation would ordinarily be a problem for the value

, however this quantity appears in both numerator and denominator and the two cancel leaving good relative accuracy in the final result.

Each Lagrange basis polynomial can also be written in barycentric form: 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

, 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.

But, as can be seen from the construction, each time a node xk changes, all Lagrange basis polynomials have to be recalculated.

A better form of the interpolation polynomial for practical (or computational) purposes is the barycentric form of the Lagrange interpolation (see below) or Newton polynomials.

Lagrange and other interpolation at equally spaced points, as in the example above, yield a polynomial oscillating above and below the true function.

This behaviour tends to grow with the number of points, leading to a divergence known as Runge's phenomenon; the problem may be eliminated by choosing interpolation points at Chebyshev nodes.

[5] The Lagrange basis polynomials can be used in numerical integration to derive the Newton–Cotes formulas.

When interpolating a given function f by a polynomial of degree k at the nodes

The dth derivative of a Lagrange interpolating polynomial can be written in terms of the derivatives of the basis polynomials, Recall (see § Definition above) that each Lagrange basis polynomial is

Note that all of these formulas for derivatives are invalid at or near a node.

A method of evaluating all orders of derivatives of a Lagrange polynomial efficiently at all points of the domain, including the nodes, is converting the Lagrange polynomial to power basis form and then evaluating the derivatives.

The Lagrange polynomial can also be computed in finite fields.

This has applications in cryptography, such as in Shamir's Secret Sharing scheme.

This image shows, for four points ( (−9, 5) , (−4, 2) , (−1, −2) , (7, 9) ), the (cubic) interpolation polynomial L ( x ) (dashed, black), which is the sum of the scaled basis polynomials y 0 0 ( x ) , y 1 1 ( x ) , y 2 2 ( x ) and y 3 3 ( x ) . The interpolation polynomial passes through all four control points, and each scaled basis polynomial passes through its respective control point and is 0 where x corresponds to the other three control points.
Example of interpolation divergence for a set of Lagrange polynomials.