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 (xj,yj), the xj are called nodes and the yj are called values. The Lagrange polynomial L(x) which interpolates the data assumes each value at the corresponding node, L(xj)=yj. If there are k+1 data pairs, the Lagrange polynomial has degree ≤k. 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. In matrix theory, Lagrange polynomials are also related to the evaluation of matrix functions and eigenspace projection via Frobenius covariants.
Definition Given a set of k+1 nodes {x0,x1,…,xk}, which must all be distinct, xj≠xm for indices j≠m, the Lagrange basis for polynomials of degree ≤k for those nodes is the set of polynomials {ℓ0(x),ℓ1(x),…,ℓk(x)} each of degree k which take values ℓj(xm)=0 if m≠j and ℓj(xj)=1. Using the Kronecker delta this can be written ℓj(xm)=δjm. Each basis polynomial can be explicitly described by the product: ℓj(x)=(x−x0)(xj−x0)⋯(x−xj−1)(xj−xj−1)(x−xj+1)(xj−xj+1)⋯(x−xk)(xj−xk)=∏0≤m≤km≠jx−xmxj−xm|. Notice that the numerator ∏m≠j(x−xm) has k roots at the nodes {xm}m≠j while the denominator ∏m≠j(xj−xm) scales the resulting polynomial so that ℓj(xj)=1. The Lagrange interpolating polynomial for those nodes through the corresponding values {y0,y1,…,yk} is the linear combination: L(x)=∑j=0kyjℓj(x). Each basis polynomial has degree k, so the sum L(x) has degree ≤k, and it interpolates the data because L(xm)=∑j=0kyjℓj(xm)=∑j=0kyjδmj=ym. The interpolating polynomial is unique. Proof: assume some polynomial M(x) of degree ≤k interpolates the data. Then the difference M(x)−L(x) is zero at k+1 distinct nodes {x0,x1,…,xk}. But the only polynomial of degree ≤k with more than k roots is the constant zero function, so M(x)−L(x)=0, or M(x)=L(x). The unique interpolating polynomial can alternatively be constructed using Newton polynomials as an alternative basis, or generalized to Hermite interpolating polynomials when there are confluent nodes.
Barycentric form Each Lagrange basis polynomial ℓj(x) can be rewritten as the product of three parts, a function ℓ(x)=∏m(x−xm) common to every basis polynomial, a node-specific constant wj=∏m≠j(xj−xm)−1 (called the barycentric weight), and a part representing the displacement from xj to x: ℓj(x)=ℓ(x)wjx−xj By factoring ℓ(x) out from the sum, we can write the Lagrange polynomial in the so-called first barycentric form: L(x)=ℓ(x)∑j=0kwjx−xjyj. If the weights wj have been pre-computed, this requires only 𝒪(k) operations compared to 𝒪(k2) for evaluating each Lagrange basis polynomial ℓj(x) individually. (See Big O notation.) The barycentric interpolation formula can also easily be updated to incorporate a new node xk+1 by dividing each of the wj, j=0…k by (xj−xk+1) and constructing the new wk+1 as above. For any x, ∑j=0kℓj(x)=1 because the constant function g(x)=1 is the unique polynomial of degree ≤k interpolating the data {(x0,1),(x1,1),…,(xk,1)}. We can thus further simplify the barycentric formula by dividing L(x)=L(x)/g(x): L(x)=ℓ(x)∑j=0kwjx−xjyj/ℓ(x)∑j=0kwjx−xj=∑j=0kwjx−xjyj/∑j=0kwjx−xj. 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 ℓ(x); the work to compute each term in the denominator wj/(x−xj) has already been done in computing (wj/(x−xj))yj 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 xj, catastrophic cancelation would ordinarily be a problem for the value (x−xj), 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 xj will result in the indeterminate ∞yj/∞; computer implementations must replace such results by L(xj)=yj. Each Lagrange basis polynomial can also be written in barycentric form: ℓj(x)=wjx−xj/∑m=0kwmx−xm.
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 L(x)=∑j=0kxjmj, we must invert the Vandermonde matrix (xi)j to solve L(xi)=yi for the coefficients mj of L(x). By choosing a better basis, the Lagrange basis, L(x)=∑j=0kℓj(x)yj, we merely get the identity matrix, δij, which is its own inverse: the Lagrange basis automatically inverts the analog of the Vandermonde matrix. More explicitly, let L be the inverse Vandermonde matrix such that: L=(L00⋯L0n⋮⋱⋮Ln0⋯Lnn). The Lagrange basis polynomial ℓj(x) can be expressed directly using the columns of L: ℓj(x)=L0j+L1jx+⋯+Lnjxn. 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. In numerical practice, directly computing L by inverting the Vandermonde matrix is generally avoided because Vandermonde matrices are notoriously ill-conditioned. As the number of nodes or their degree increases, their condition number grows exponentially, making direct matrix inversion numerically unstable and highly sensitive to floating-point errors; one approach to circumvent these errors is to convert floating-point values into exact rational numbers and perform the inversion in exact rational arithmetic.
… excerpt ends here. Continue reading the full article.


