The Vandermonde approach requires inverting a matrix — expensive and numerically fragile for large systems. Lagrange interpolation sidesteps this entirely. Instead of solving for coefficients, it constructs a set of clever basis polynomialsLk(x) that each equal 1 at exactly one node and 0 at all others. The interpolating polynomial is then a straightforward weighted sum of these basis polynomials.
The Lagrange Formula
Given n+1 nodes (x0,f(x0)),…,(xn,f(xn)), the Lagrange interpolating polynomial is:
Pn(x)=∑k=0nf(xk)Lk(x)
where each Lagrange basis polynomialLk(x) is defined as:
Lk(x)=∏j=0j=knxk−xjx−xj
The Kronecker Delta Property
The basis polynomials are engineered to satisfy:
Lk(xj)=δkj={10if k=jif k=j
This is what guarantees Pn(xi)=f(xi) for every node — each Lk activates (equals 1) at its own node xk and is silent (equals 0) at every other node.
Example: Verifying L2(x) for 3 nodes
To see this in action, let’s look at a system with three nodes: x0,x1, and x2. By definition, the basis polynomial L2(x) is constructed by including x0 and x1 in the product, but omitting x2:
L2(x)=(x2−x0)(x2−x1)(x−x0)(x−x1)
Let’s calculate the multiplication when we evaluate this polynomial at each specific node:
At x=x0 (where k=j):L2(x0)=(x2−x0)(x2−x1)(x0−x0)(x0−x1)=(x2−x0)(x2−x1)0⋅(x0−x1)=0
Why it is 0: Substituting x0 creates an (x0−x0) term. This turns the numerator into zero, making the whole expression 0.
At x=x1 (where k=j):L2(x1)=(x2−x0)(x2−x1)(x1−x0)(x1−x1)=(x2−x0)(x2−x1)(x1−x0)⋅0=0
Why it is 0: Substituting x1 creates an (x1−x1) term, turning the numerator and the final result to zero.
At x=x2 (where k=j):L2(x2)=(x2−x0)(x2−x1)(x2−x0)(x2−x1)=1
Why it is 1: Substituting x2 makes the numerator exactly identical to the denominator. Any non-zero value divided by itself equals 1.
The Basis Sums to 1
A companion property is that the basis polynomials add up to 1 at every x:
∑k=0nLk(x)=1
Deriving lk(x) from First Principles
We can use the Kronecker delta property to mathematically build a specific basis polynomial from scratch. Let’s find l2(x) for a system with 4 nodes where n=3.
Here n=3, meaning our nodes are x0,x1,x2,x3. We are looking for lk(x) where k=2.
Based on the rule lk(xj)=1 when k=j and 0 when k=j, we know the following must be true:
l2(x0)=0
l2(x1)=0
l2(x3)=0
l2(x2)=1
Because l2(x) evaluates to zero at x0,x1, and x3, these three points are the roots of the polynomial.
Knowing the roots, we can write the polynomial with an unknown constant C:
l2(x)=C(x−x0)(x−x1)(x−x3)
To find C, substitute x=x2 into the equation:
l2(x2)=C(x2−x0)(x2−x1)(x2−x3)
Since we know l2(x2)=1, we can substitute 1 on the left side:
1=C(x2−x0)(x2−x1)(x2−x3)
Isolating C gives us:
C=(x2−x0)(x2−x1)(x2−x3)1
Substitute C back into the general equation to get the completed basis polynomial:
l2(x)=(x2−x0)(x2−x1)(x2−x3)(x−x0)(x−x1)(x−x3)
Worked Example: 3 Nodes
Problem: Find the interpolating polynomial through the following three data points.
xk
f(xk)
1
2
2
3
4
1
Step 1: Compute the Basis Polynomials
L0(x): The product omits j=0, so it includes terms for j=1 and j=2:
Lagrange interpolation has one significant drawback: adding a new node forces a complete rebuild of every basis polynomial.
To see why, consider L0(x) with the original three nodes:
L0(x)=(x0−x1)(x0−x2)(x−x1)(x−x2)
Now suppose we add a fourth node x3. The Kronecker delta property requires L0(x3)=0, which means (x−x3) must appear in the numerator. Similarly, (x0−x3) must appear in the denominator. The basis polynomial becomes:
This is a different function from the original L0(x) — every basis polynomial picks up a new factor in both numerator and denominator. L1, L2, and any others must all be rebuilt as well. None of the work done for the 3-node case carries forward.