Lagrange Interpolation

Lagrange interpolation is a method for constructing the unique polynomial of degree at most that passes through a given points number of points. For points with all -values distinct, the Lagrange interpolating polynomial is defined as

where each is a polynomial that equals at and at all other , defined by

Each term “activates” the value at point , and the sum reconstructs a polynomial that agrees with all given points.

Intuition

At its core, the Lagrange interpolation polynomial acts like a selector. It’s designed so that at any known input , only the corresponding output value “activates,” while all the other terms go to zero. That means at each known data point, the polynomial behaves exactly like a switchboard: it connects the input to the output , and only that one. For all other , the function returns zero, so their corresponding values are effectively ignored at that moment.

The key to this selective behavior lies in the construction of each basis function . The numerator of includes the variable and every where That’s why is zero when for any : it contains a factor like , which kills the whole term. But when , none of those subtracted terms zero out, so the numerator becomes a meaningful, nonzero number. This structure ensures that only “activates” for the one point it’s designed to represent.

The denominator plays the role of a normalizing constant. It’s calculated by plugging the target input into the same expression used in the numerator. Since we know that’s the only input that makes the numerator nonzero, we simply scale the entire fraction so that . This is critical, as it ensures that when we multiply , the result is exactly at , not some scaled version of it. For every other , the numerator vanishes, and , meaning won’t interfere.

Examples

(Medium) Lagrange? More like Lamegrange.

In this problem, you will walk through an alternative to Lagrange interpolation.

To begin, let’s say we wanted to interpolate a polynomial through a single point, .

Call the polynomial from the previous part . Now say we wanted to define the polynomial that passes through the points and .

Now say we want a polynomial that passes through , , and .