Hubbry Logo
Lagrange polynomialLagrange polynomialMain
Open search
Lagrange polynomial
Community hub
Lagrange polynomial
logo
8 pages, 0 posts
0 subscribers
Be the first to start a discussion here.
Be the first to start a discussion here.
Lagrange polynomial
Lagrange polynomial
from Wikipedia
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 y00(x), y11(x), y22(x) and y33(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.

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 with the are called nodes and the are called values. The Lagrange polynomial has degree and assumes each value at the corresponding node,

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.

Definition

[edit]

Given a set of nodes , which must all be distinct, for indices , the Lagrange basis for polynomials of degree for those nodes is the set of polynomials each of degree which take values if and . Using the Kronecker delta this can be written Each basis polynomial can be explicitly described by the product:

Notice that the numerator has 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 , so the sum has degree , and it interpolates the data because

The interpolating polynomial is unique. Proof: assume the polynomial of degree interpolates the data. Then the difference is zero at distinct nodes But the only polynomial of degree with more than roots is the constant zero function, so or

Barycentric form

[edit]

Each Lagrange basis polynomial 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 to :[4]

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

If the weights have been pre-computed, this requires only operations compared to for evaluating each Lagrange basis polynomial 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.

For any because the constant function is the unique polynomial of degree 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 ; the work to compute each term in the denominator has already been done in computing and so computing the sum in the denominator costs only addition operations; for evaluation points which are close to one of the nodes , 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.

Using this formula to evaluate at one of the nodes 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

[edit]

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

[edit]

We wish to interpolate over the domain at the three nodes :

The node polynomial is

The barycentric weights are

The Lagrange basis polynomials are

The Lagrange interpolating polynomial is:

In (second) barycentric form,

Notes

[edit]

Remainder in Lagrange interpolation formula

[edit]

When interpolating a given function f by a polynomial of degree k at the nodes we get the remainder which can be expressed as[6]

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

[edit]

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 . We choose so that has zeroes (at all nodes and ) between and (including endpoints). Assuming that is -times differentiable, since and are polynomials, and therefore, are infinitely differentiable, will be -times differentiable. By Rolle's theorem, has zeroes, has zeroes... has 1 zero, say . Explicitly writing :

(Because the highest power of in is )

The equation can be rearranged as[7]

Since we have

Derivatives

[edit]

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

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

[edit]

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

See also

[edit]

References

[edit]
[edit]
Revisions and contributorsEdit on WikipediaRead on Wikipedia
from Grokipedia
In numerical analysis, the Lagrange interpolating polynomial is the unique polynomial of degree at most n1n-1 that passes through a given set of nn distinct points (xk,yk)(x_k, y_k) for k=1,,nk = 1, \dots, n, where the yky_k values are typically samples of some underlying function f(x)f(x) evaluated at the xkx_k. This construction provides an explicit way to approximate f(x)f(x) at arbitrary points by ensuring exact agreement at the interpolation nodes, making it a cornerstone method for polynomial interpolation. The formula for the Lagrange interpolating polynomial P(x)P(x) is given by P(x)=i=1nyii(x),P(x) = \sum_{i=1}^n y_i \ell_i(x), where each basis polynomial i(x)\ell_i(x) is defined as i(x)=1jnjixxjxixj.\ell_i(x) = \prod_{\substack{1 \leq j \leq n \\ j \neq i}} \frac{x - x_j}{x_i - x_j}. Each i(x)\ell_i(x) satisfies i(xk)=δik\ell_i(x_k) = \delta_{ik} (the ), ensuring P(xi)=yiP(x_i) = y_i for all ii. Although named after the Italian-French mathematician , who formalized and published the method in his 1795 work Théorie des fonctions analytiques, the formula was originally discovered by Edward Waring in 1779 and independently rediscovered by Leonhard Euler in 1783. Key properties of the Lagrange polynomial include its explicit computability without solving systems of equations, unlike Newton interpolation, though it can suffer from —oscillations near the endpoints—for high-degree approximations on equispaced nodes. It also admits efficient barycentric forms for and evaluation. Applications span numerical methods, where it facilitates and derivative estimation from discrete data; for ; and physics simulations for modeling continuous phenomena from sampled measurements. In engineering and scientific computing, it underpins techniques like numerical quadrature and finite element methods.

Fundamentals

Definition

Lagrange interpolation constructs a P(x)P(x) of degree at most nn that passes through n+1n+1 given distinct points (x0,y0),,(xn,yn)(x_0, y_0), \dots, (x_n, y_n), where the xix_i are distinct real or complex numbers and the yiy_i are the corresponding values, often yi=f(xi)y_i = f(x_i) for some function ff. The interpolating is explicitly given by the P(x)=i=0nyii(x),P(x) = \sum_{i=0}^n y_i \ell_i(x), where the i(x)\ell_i(x) are the Lagrange basis polynomials defined as i(x)=j=0jinxxjxixj.\ell_i(x) = \prod_{\substack{j=0 \\ j \neq i}}^n \frac{x - x_j}{x_i - x_j}. Each basis polynomial i(x)\ell_i(x) is of degree nn and satisfies i(xk)=δik\ell_i(x_k) = \delta_{ik}, the , ensuring P(xk)=ykP(x_k) = y_k for each kk. This form assumes the interpolation points xix_i are distinct, as the denominators in the basis polynomials would otherwise be zero. The Lagrange formulation offers an explicit, direct expression for the without requiring the computation of , unlike the Newton form.

Illustrative Example

To illustrate the construction of a Lagrange , consider the task of finding a polynomial P(x)P(x) of degree at most 2 that interpolates the points (0,1)(0, 1), (1,2)(1, 2), and (2,0)(2, 0). The basis polynomials are computed as follows: 0(x)=(x1)(x2)(01)(02)=(x1)(x2)2\ell_0(x) = \frac{(x - 1)(x - 2)}{(0 - 1)(0 - 2)} = \frac{(x - 1)(x - 2)}{2} 1(x)=(x0)(x2)(10)(12)=x(x2)1=x(x2)\ell_1(x) = \frac{(x - 0)(x - 2)}{(1 - 0)(1 - 2)} = \frac{x(x - 2)}{-1} = -x(x - 2) 2(x)=(x0)(x1)(20)(21)=x(x1)2\ell_2(x) = \frac{(x - 0)(x - 1)}{(2 - 0)(2 - 1)} = \frac{x(x - 1)}{2} The interpolating polynomial is then P(x)=10(x)+21(x)+02(x)=(x1)(x2)2+2[x(x2)].P(x) = 1 \cdot \ell_0(x) + 2 \cdot \ell_1(x) + 0 \cdot \ell_2(x) = \frac{(x - 1)(x - 2)}{2} + 2 \left[ -x(x - 2) \right]. Expanding this yields P(x)=x23x+222x(x2)=x23x+222x2+4x=32x2+52x+1.P(x) = \frac{x^2 - 3x + 2}{2} - 2x(x - 2) = \frac{x^2 - 3x + 2}{2} - 2x^2 + 4x = -\frac{3}{2}x^2 + \frac{5}{2}x + 1. To verify, evaluate P(x)P(x) at the interpolation points:
  • P(0)=32(0)2+52(0)+1=1P(0) = -\frac{3}{2}(0)^2 + \frac{5}{2}(0) + 1 = 1
  • P(1)=32(1)2+52(1)+1=32+52+1=2P(1) = -\frac{3}{2}(1)^2 + \frac{5}{2}(1) + 1 = -\frac{3}{2} + \frac{5}{2} + 1 = 2
  • P(2)=32(4)+52(2)+1=6+5+1=0P(2) = -\frac{3}{2}(4) + \frac{5}{2}(2) + 1 = -6 + 5 + 1 = 0
The values match the given points, confirming the polynomial passes through them. For further intuition, the following table shows P(x)P(x) evaluated at additional points between 0 and 2:
xxP(x)P(x)
0.51.875
1.51.375
This quadratic curve connects the points smoothly, demonstrating how Lagrange interpolation produces an exact fit at the specified locations.

Formulation

Basis Polynomials

The Lagrange basis polynomials, denoted i(x)\ell_i(x) for i=0,1,,ni = 0, 1, \dots, n, serve as the building blocks for the Lagrange scheme given n+1n+1 distinct nodes x0,x1,,xnx_0, x_1, \dots, x_n. Each i(x)\ell_i(x) is the unique of degree at most nn such that i(xi)=1\ell_i(x_i) = 1 and i(xj)=0\ell_i(x_j) = 0 for all jij \neq i. This uniqueness follows from the fact that the of of degree at most nn has n+1n+1, and the n+1n+1 interpolation conditions imposed on i(x)\ell_i(x) form a linearly independent set. The explicit construction of i(x)\ell_i(x) takes the product form i(x)=0jnjixxjxixj.\ell_i(x) = \prod_{\substack{0 \leq j \leq n \\ j \neq i}} \frac{x - x_j}{x_i - x_j}. This formula directly enforces the required properties: when x=xix = x_i, each factor in the numerator equals the corresponding factor in the denominator, yielding i(xi)=1\ell_i(x_i) = 1; when x=xkx = x_k for kik \neq i, the numerator includes a factor of zero while the denominator does not, yielding i(xk)=0\ell_i(x_k) = 0. Each basis polynomial i(x)\ell_i(x) has exact degree nn, arising from the product of nn linear terms in the numerator. A key characteristic of the Lagrange basis polynomials is their from the interpolated values yi=f(xi)y_i = f(x_i); they depend only on the node locations xix_i. Consequently, the i(x)\ell_i(x) can be precomputed for a fixed set of nodes and reused to construct interpolants for any function values at those nodes, enhancing computational efficiency in repeated tasks on the same grid.

Interpolation Formula

The Lagrange interpolating polynomial P(x)P(x) for a function f(x)f(x) at n+1n+1 distinct points (x0,y0),(x1,y1),,(xn,yn)(x_0, y_0), (x_1, y_1), \dots, (x_n, y_n), where yi=f(xi)y_i = f(x_i), is constructed by linearly combining the Lagrange basis polynomials i(x)\ell_i(x) weighted by the corresponding data values yiy_i. Specifically, the formula is given by P(x)=i=0nyii(x),P(x) = \sum_{i=0}^n y_i \ell_i(x), where each basis polynomial is i(x)=j=0jinxxjxixj.\ell_i(x) = \prod_{\substack{j=0 \\ j \neq i}}^n \frac{x - x_j}{x_i - x_j}. This form arises directly from the properties of the basis polynomials, which are designed such that i(xk)=δik\ell_i(x_k) = \delta_{ik} (the Kronecker delta, equal to 1 if i=ki = k and 0 otherwise) for k=0,,nk = 0, \dots, n. Substituting x=xkx = x_k into the formula yields P(xk)=i=0nyiδik=ykP(x_k) = \sum_{i=0}^n y_i \delta_{ik} = y_k, ensuring that P(x)P(x) exactly matches f(x)f(x) at each interpolation node xkx_k. The formula effectively blends the data values yiy_i according to their proximity to the evaluation point xx: the weight i(x)\ell_i(x) is close to 1 when xx is near xix_i (since the product emphasizes small denominators for nearby points) and close to 0 when xx is far from xix_i, providing a smooth transition between the given points. The resulting P(x)P(x) is a of degree at most nn, as each i(x)\ell_i(x) is of degree nn and the preserves this bound. Direct evaluation of P(x)P(x) at a single point requires computing each of the n+1n+1 basis polynomials, each involving nn multiplications and divisions, leading to O(n2)O(n^2) arithmetic operations overall without any preprocessing.

Properties

Uniqueness

The uniqueness theorem states that for any set of n+1n+1 distinct points (x0,y0),,(xn,yn)(x_0, y_0), \dots, (x_n, y_n) in the plane, there exists at most one polynomial PP of degree at most nn such that P(xi)=yiP(x_i) = y_i for each i=0,,ni = 0, \dots, n. To prove this, suppose there are two polynomials PP and QQ, both of degree at most nn, satisfying the interpolation conditions: P(xi)=yiP(x_i) = y_i and Q(xi)=yiQ(x_i) = y_i for i=0,,ni = 0, \dots, n. Consider the difference R(x)=P(x)Q(x)R(x) = P(x) - Q(x). Then degRn\deg R \leq n, and R(xi)=0R(x_i) = 0 for each of the n+1n+1 distinct points xix_i. A nonzero polynomial of degree at most nn can have at most nn roots, unless it is the zero polynomial. Since RR has n+1n+1 roots, it must be identically zero, so P(x)=Q(x)P(x) = Q(x) for all xx. Therefore, P(x)=Q(x)P(x) = Q(x) for all xx, which establishes the uniqueness of the interpolating polynomial as asserted by the theorem. The proof relies on the fundamental property that a polynomial of degree at most nn is uniquely determined by its values at n+1n+1 distinct points, a direct consequence of the and the fact that polynomials are analytic functions with isolated roots unless identically zero. As the Lagrange interpolation formula explicitly constructs a polynomial of degree at most nn that satisfies the given conditions, it follows that this construction yields the unique such interpolating polynomial. An alternative perspective views the space Pn\mathcal{P}_n of all polynomials of degree at most nn over the real numbers as of n+1n+1, with basis {1,x,x2,,xn}\{1, x, x^2, \dots, x^n\}. The map sending PPnP \in \mathcal{P}_n to the vector (P(x0),,P(xn))Rn+1(P(x_0), \dots, P(x_n)) \in \mathbb{R}^{n+1} is a linear transformation. For distinct xix_i, this map is represented by the Vandermonde matrix, which has full rank n+1n+1 and is thus invertible. The invertibility implies that the map is bijective, so for any target vector (y0,,yn)(y_0, \dots, y_n), there is exactly one PPnP \in \mathcal{P}_n mapping to it, confirming both existence and uniqueness of the interpolant.

Derivatives

The k-th derivative of the Lagrange interpolating P(x)=i=0nyii(x)P(x) = \sum_{i=0}^n y_i \ell_i(x) is given by term-by-term differentiation: P(k)(x)=i=0nyii(k)(x),P^{(k)}(x) = \sum_{i=0}^n y_i \ell_i^{(k)}(x), where i(k)(x)\ell_i^{(k)}(x) is the k-th of the i-th basis i(x)\ell_i(x). This formula holds because differentiation is linear and commutes with . Each basis i(x)\ell_i(x) has degree n, so its k-th i(k)(x)\ell_i^{(k)}(x) has degree at most n - k, implying that P(k)(x)P^{(k)}(x) has degree at most n - k. The explicit form of i(k)(x)\ell_i^{(k)}(x) arises from repeated application of the to i(x)=jixxjxixj\ell_i(x) = \prod_{j \neq i} \frac{x - x_j}{x_i - x_j}, resulting in expressions that are sums of polynomials of degree n - k. These terms resemble Lagrange basis polynomials of lower degree constructed over reduced sets of the original points excluding certain xjx_j. The Lagrange framework extends naturally to Hermite interpolation, which incorporates derivative values at the interpolation points as additional conditions. For the case of n+1 distinct points x0,,xnx_0, \dots, x_n where both function values f(xi)f(x_i) and first derivatives f(xi)f'(x_i) are specified, the unique Hermite interpolating polynomial H(x)H(x) of degree at most 2n + 1 takes the form H(x)=i=0n[f(xi)(12i(xi)(xxi))i2(x)+f(xi)(xxi)i2(x)].H(x) = \sum_{i=0}^n \left[ f(x_i) \left( 1 - 2 \ell_i'(x_i) (x - x_i) \right) \ell_i^2(x) + f'(x_i) (x - x_i) \ell_i^2(x) \right]. This construction ensures H(xi)=f(xi)H(x_i) = f(x_i) and H(xi)=f(xi)H'(x_i) = f'(x_i) for each i, as the squared basis i2(x)\ell_i^2(x) vanishes to second order at all other points xjx_j (j ≠ i), while the linear factors adjust the derivative conditions. For higher-order derivatives up to order m_i - 1 at each point (with total degree at most (mi)1\sum (m_i) - 1), the generalized Hermite form uses higher powers of i(x)\ell_i(x) multiplied by polynomials that satisfy the moment conditions at xix_i. A practical application of these derivatives is , where P(k)(x)P^{(k)}(x) or H(k)(x)H^{(k)}(x) approximates the k-th derivative of an underlying function f within the interval, leveraging the known values and the of the basis.

Error Analysis

Remainder Term

When interpolating a function ff that is n+1n+1 times continuously differentiable on an interval containing the distinct nodes x0,x1,,xnx_0, x_1, \dots, x_n and the evaluation point xx, the Lagrange polynomial Pn(x)P_n(x) of degree at most nn satisfies the conditions Pn(xi)=f(xi)P_n(x_i) = f(x_i) for i=0,,ni = 0, \dots, n. The , or term, is given by f(x)Pn(x)=f(n+1)(ξ)(n+1)!i=0n(xxi),f(x) - P_n(x) = \frac{f^{(n+1)}(\xi)}{(n+1)!} \prod_{i=0}^n (x - x_i), where ξ\xi lies in the smallest interval containing x0,,xn,xx_0, \dots, x_n, x. The product i=0n(xxi)\prod_{i=0}^n (x - x_i) is known as the nodal polynomial, which quantifies the geometric from xx to the interpolation nodes; it vanishes at each xix_i, ensuring the error is zero at the nodes as required. The factor f(n+1)(ξ)(n+1)!\frac{f^{(n+1)}(\xi)}{(n+1)!} captures the local smoothness of ff, with the remainder depending on the magnitude of the (n+1)(n+1)-th and the node spacing. This form implies that the approximation error can be bounded by M(n+1)!maxxIi=0n(xxi)\frac{M}{(n+1)!} \max_{x \in I} \left| \prod_{i=0}^n (x - x_i) \right|, where M=maxf(n+1)(ξ)M = \max |f^{(n+1)}(\xi)| over the relevant interval II, highlighting how denser or better-distributed nodes reduce the error for smooth functions. However, for equispaced nodes over large intervals, the nodal polynomial grows rapidly near the endpoints, leading to the Runge phenomenon—large oscillations in the interpolant that fail to converge uniformly to ff, even for analytic functions like f(x)=11+25x2f(x) = \frac{1}{1 + 25x^2} on [1,1][-1, 1].

Derivation of Remainder

To derive the remainder term in the Lagrange interpolation error, assume that the interpolation points x0,x1,,xnx_0, x_1, \dots, x_n are distinct and lie in an interval containing the evaluation point xx, and that the function ff is (n+1)(n+1)-times continuously differentiable on this interval, i.e., fCn+1f \in C^{n+1}. Let P(x)P(x) denote the unique Lagrange interpolating polynomial of degree at most nn such that P(xi)=f(xi)P(x_i) = f(x_i) for i=0,1,,ni = 0, 1, \dots, n. The error function is defined as e(x)=f(x)P(x)e(x) = f(x) - P(x), which satisfies e(xi)=0e(x_i) = 0 for each i=0,1,,ni = 0, 1, \dots, n. Consider the auxiliary function ϕ(t)=e(t)e(x)ω(x)ω(t)\phi(t) = e(t) - \frac{e(x)}{\omega(x)} \omega(t), where ω(t)=i=0n(txi)\omega(t) = \prod_{i=0}^n (t - x_i) is the of degree n+1n+1 with roots at the interpolation points. By construction, ϕ(xi)=0\phi(x_i) = 0 for i=0,1,,ni = 0, 1, \dots, n, and also ϕ(x)=0\phi(x) = 0, so ϕ(t)\phi(t) has n+2n+2 distinct zeros (assuming xxix \neq x_i for all ii). Since ϕ(t)\phi(t) is (n+1)(n+1)-times differentiable and has n+2n+2 zeros, repeated application of implies that there exists some point ξ\xi in the interval spanned by x0,,xn,xx_0, \dots, x_n, x such that ϕ(n+1)(ξ)=0\phi^{(n+1)}(\xi) = 0. Differentiating ϕ(t)\phi(t) n+1n+1 times yields ϕ(n+1)(t)=f(n+1)(t)e(x)ω(x)(n+1)!,\phi^{(n+1)}(t) = f^{(n+1)}(t) - \frac{e(x)}{\omega(x)} \cdot (n+1)!, because the (n+1)(n+1)-th derivative of ω(t)\omega(t) is the constant (n+1)!(n+1)! (as ω(t)\omega(t) is monic of degree n+1n+1) and P(t)P(t) is a of degree at most nn, so its (n+1)(n+1)-th derivative vanishes. Setting ϕ(n+1)(ξ)=0\phi^{(n+1)}(\xi) = 0 gives 0=f(n+1)(ξ)e(x)ω(x)(n+1)!,0 = f^{(n+1)}(\xi) - \frac{e(x)}{\omega(x)} \cdot (n+1)!, so e(x)=f(n+1)(ξ)(n+1)!ω(x)=f(n+1)(ξ)(n+1)!i=0n(xxi)e(x) = \frac{f^{(n+1)}(\xi)}{(n+1)!} \omega(x) = \frac{f^{(n+1)}(\xi)}{(n+1)!} \prod_{i=0}^n (x - x_i) for some ξ\xi between the minimum and maximum of {x0,,xn,x}\{x_0, \dots, x_n, x\}.

Representations

Barycentric Form

The barycentric form provides a computationally efficient and numerically stable alternative to the standard Lagrange interpolation formula for evaluating the interpolating polynomial P(x)P(x) at a point xx. It reformulates the interpolation by introducing precomputed barycentric weights wi=1j=0,jin(xixj)w_i = \frac{1}{\prod_{j=0, j \neq i}^n (x_i - x_j)} for i=0,,ni = 0, \dots, n, which capture the denominators of the Lagrange basis polynomials. The first barycentric form expresses the interpolant as P(x)=i=0nwixxiyii=0nwixxi,P(x) = \frac{\sum_{i=0}^n \frac{w_i}{x - x_i} y_i}{\sum_{i=0}^n \frac{w_i}{x - x_i}}, where the sums are taken over the distinct interpolation nodes x0,,xnx_0, \dots, x_n and corresponding values y0,,yny_0, \dots, y_n. This form requires O(n2)O(n^2) operations to compute the weights wiw_i once, followed by O(n)O(n) operations per evaluation of P(x)P(x), making it suitable for repeated evaluations. Compared to the direct Lagrange form, the barycentric approach is superior in , particularly for equispaced nodes or when evaluating near the interpolation points, as it sidesteps the explicit formation of large intermediate products that can lead to subtractive cancellation. The preprocessing cost of O(n2)O(n^2) is offset by the linear-time evaluation, rendering it the preferred method for practical implementations of .

Linear Algebra View

The interpolating P(x)P(x) of degree at most nn that passes through the distinct points (xi,yi)(x_i, y_i) for i=0,,ni = 0, \dots, n can be expressed in the as P(x)=k=0nckxk,P(x) = \sum_{k=0}^n c_k x^k, where the coefficient vector c=(c0,,cn)T\mathbf{c} = (c_0, \dots, c_n)^T satisfies the Vc=yV \mathbf{c} = \mathbf{y}. Here, VV is the (n+1)×(n+1)(n+1) \times (n+1) with entries Vi,j=xijV_{i,j} = x_i^j for i,j=0,,ni,j = 0, \dots, n, and y=(y0,,yn)T\mathbf{y} = (y_0, \dots, y_n)^T is the vector of data values. This system has a unique solution because VV is invertible whenever the xix_i are distinct, ensuring the existence and uniqueness of the interpolating of degree at most nn. The Lagrange form provides an explicit expression for P(x)P(x) without directly solving for c\mathbf{c}: P(x)=i=0nyii(x)P(x) = \sum_{i=0}^n y_i \ell_i(x), where each Lagrange basis polynomial i(x)\ell_i(x) satisfies i(xj)=δij\ell_i(x_j) = \delta_{i j}. In the , i(x)=k=0nakixk\ell_i(x) = \sum_{k=0}^n a_{k i} x^k, and the matrix A=(aki)A = (a_{k i}) is precisely the inverse V1V^{-1}, with the coefficients of i(x)\ell_i(x) given by the ii-th column of V1V^{-1}. Consequently, the coefficients of P(x)P(x) are c=V1y\mathbf{c} = V^{-1} \mathbf{y}, highlighting how the Lagrange basis implicitly applies the inverse of the to the data vector in the . The condition number κ(V)\kappa(V) of the Vandermonde matrix grows exponentially with nn for equispaced interpolation points, often as O(2n/n)O(2^n / \sqrt{n})
Add your contribution
Related Hubs
User Avatar
No comments yet.