Lagrange polynomial

1

In numerical analysis, the Lagrange interpolating polynomial is the unique polynomial of lowest degree that interpolates a given set of data. Given a data set of coordinate pairs (x_j, y_j) with the x_j are called nodes and the y_j are called values. The Lagrange polynomial L(x) has degree \leq k and assumes each value at the corresponding node, 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, 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.

Definition

Given a set of k + 1 nodes, which must all be distinct, for indices j \neq m, the Lagrange basis for polynomials of degree \leq k for those nodes is the set of polynomials each of degree k which take values if m \neq j and. Using the Kronecker delta this can be written Each basis polynomial can be explicitly described by the product: Notice that the numerator has k roots at the nodes while the denominator scales the resulting polynomial so that The Lagrange interpolating polynomial for those nodes through the corresponding values is the linear combination: Each basis polynomial has degree k, so the sum L(x) has degree \leq k, and it interpolates the data because The interpolating polynomial is unique. Proof: assume the polynomial M(x) of degree \leq k interpolates the data. Then the difference M(x) - L(x) is zero at k + 1 distinct nodes But the only polynomial of degree \leq k with more than k roots is the constant zero function, so or

Barycentric form

Each Lagrange basis polynomial \ell_j(x) can be rewritten as the product of three parts, a function common to every basis polynomial, a node-specific constant (called the barycentric weight), and a part representing the displacement from x_j to x: By factoring \ell(x) out from the sum, we can write the Lagrange polynomial in the so-called first barycentric form: If the weights w_j have been pre-computed, this requires only operations compared to for evaluating each Lagrange basis polynomial \ell_j(x) individually. The barycentric interpolation formula can also easily be updated to incorporate a new node x_{k+1} by dividing each of the w_j, j=0 \dots k by and constructing the new w_{k+1} as above. For any x, because the constant function g(x) = 1 is the unique polynomial of degree \leq k interpolating the data We can thus further simplify the barycentric formula by dividing This is called the second form or true form of the barycentric interpolation formula. This second form has advantages in computation cost and accuracy: it avoids evaluation of \ell(x); the work to compute each term in the denominator w_j/(x-x_j) has already been done in computing and so computing the sum in the denominator costs only k addition operations; for evaluation points x which are close to one of the nodes x_j, catastrophic cancelation would ordinarily be a problem for the value (x-x_j), however this quantity appears in both numerator and denominator and the two cancel leaving good relative accuracy in the final result. Using this formula to evaluate L(x) at one of the nodes x_j will result in the indeterminate ; computer implementations must replace such results by Each Lagrange basis polynomial can also be written in barycentric form:

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 (x_i)^j to solve for the coefficients m_j of L(x). By choosing a better basis, the Lagrange basis,, we merely get the identity matrix, \delta {ij}, 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.

Example

We wish to interpolate f(x) = x^2 over the domain at the three nodes : The node polynomial \ell is The barycentric weights are The Lagrange basis polynomials are The Lagrange interpolating polynomial is: In (second) barycentric form,

Remainder in Lagrange interpolation formula

When interpolating a given function f by a polynomial of degree k at the nodes x_0,...,x_k 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, R(x) is zero at nodes. To find R(x) at a point x_p, define a new function and choose where C is the constant we are required to determine for a given x_p. We choose C so that F(x) has k+2 zeroes (at all nodes and x_p) between x_0 and x_k (including endpoints). Assuming that f(x) is k+1-times differentiable, since L(x) and are polynomials, and therefore, are infinitely differentiable, F(x) will be k+1-times differentiable. By Rolle's theorem, F^{(1)}(x) has k+1 zeroes, F^{(2)}(x) has k zeroes... F^{(k+1)} has 1 zero, say. Explicitly writing : The equation can be rearranged as Since F(x_p) = 0 we have

Derivatives

The dth derivative of a Lagrange interpolating polynomial can be written in terms of the derivatives of the basis polynomials, Recall (see above) that each Lagrange basis polynomial is The first derivative can be found using the product rule: The second derivative is The third derivative is and likewise for higher derivatives. 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.

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.

This article is derived from Wikipedia and licensed under CC BY-SA 4.0. View the original article.

Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc.
Bliptext is not affiliated with or endorsed by Wikipedia or the Wikimedia Foundation.

Edit article