4. Interpolation I

Lagrange Form

Lagrange Form of Interpolation

Introduction

Interpolation is a way to build a function that matches known data points and helps estimate values in between them πŸ“ˆ. In Numerical Analysis, this is useful when we know a few measured values but do not have a full formula. For example, a weather app may know temperatures at certain times and want to estimate the temperature at a time in between. students, this lesson focuses on the Lagrange form, one of the most important polynomial interpolation methods.

By the end of this lesson, you will be able to:

  • explain the main ideas and vocabulary behind the Lagrange form,
  • apply the Lagrange interpolation procedure to data points,
  • connect Lagrange form to the larger topic of Interpolation I,
  • summarize why it matters in Numerical Analysis,
  • use examples to understand how the formula works in practice.

The big idea is simple: given $n+1$ data points with different $x$ values, the Lagrange form builds a unique polynomial of degree at most $n$ that passes through all of them. This polynomial is called the interpolating polynomial.

What the Lagrange Form Does

Suppose we are given points $\left(x_0,y_0\right),\left(x_1,y_1\right),\dots,\left(x_n,y_n\right)$, where all the $x_i$ values are different. The goal is to find a polynomial $P_n\left(x\right)$ such that

$$P_n\left(x_i\right)=y_i\quad \text{for } i=0,1,\dots,n.$$

This means the polynomial exactly matches every data point. In the Lagrange form, the polynomial is written as

$$P_n\left(x\right)=\sum_{i=0}^{n} y_i L_i\left(x\right),$$

where each $L_i\left(x\right)$ is a Lagrange basis polynomial. These basis polynomials are designed so that

$$L_i\left(x_j\right)=\begin{cases}1,& i=j\\0,& i\ne j\end{cases}.$$

That property is the heart of the method. When $x=x_j$, every term in the sum becomes zero except the one with $i=j$, so the polynomial gives exactly $y_j$. This makes Lagrange interpolation very neat and very direct ✨.

A common formula for the basis polynomial is

$$L_i\left(x\right)=\prod_{\substack{j=0\\ j\ne i}}^{n}\frac{x-x_j}{x_i-x_j}.$$

The product means multiply together all the factors except the one where $j=i$. Each denominator $x_i-x_j$ is a constant, so once the data points are known, each $L_i\left(x\right)$ can be built from the $x$ values alone.

Understanding the Basis Polynomials

The basis polynomials are created to act like β€œswitches” πŸ”˜. Each one turns on at one chosen point and turns off at all the others.

For example, if we have three data points, then the Lagrange form uses three basis polynomials:

$$P_2\left(x\right)=y_0L_0\left(x\right)+y_1L_1\left(x\right)+y_2L_2\left(x\right).$$

Each basis polynomial has degree $2$ because it contains two factors in the product. More generally, if there are $n+1$ points, then each basis polynomial has degree $n$.

Let us see why the special property works. Suppose $i\ne j$. Then one factor in $L_i\left(x_j\right)$ becomes

$$x_j-x_j=0,$$

so the whole product becomes $0$. If $i=j$, then each factor is

$$\frac{x_j-x_k}{x_j-x_k}=1\quad \text{for } k\ne j,$$

so the whole product becomes $1$. That is why the basis polynomial picks out exactly one data value.

This design is very powerful because it lets us build the full interpolating polynomial by combining the data values $y_i$ with the basis functions $L_i\left(x\right)$.

Worked Example

Let us interpolate three points:

$$\left(1,2\right),\left(2,3\right),\left(4,1\right).$$

We want a polynomial $P_2\left(x\right)$ that passes through all three points.

First, construct the basis polynomials.

For $L_0\left(x\right)$ with $x_0=1$:

$$L_0\left(x\right)=\frac{\left(x-2\right)\left(x-4\right)}{\left(1-2\right)\left(1-4\right)}=\frac{\left(x-2\right)\left(x-4\right)}{3}.$$

For $L_1\left(x\right)$ with $x_1=2$:

$$L_1\left(x\right)=\frac{\left(x-1\right)\left(x-4\right)}{\left(2-1\right)\left(2-4\right)}=-\frac{\left(x-1\right)\left(x-4\right)}{2}.$$

For $L_2\left(x\right)$ with $x_2=4$:

$$L_2\left(x\right)=\frac{\left(x-1\right)\left(x-2\right)}{\left(4-1\right)\left(4-2\right)}=\frac{\left(x-1\right)\left(x-2\right)}{6}.$$

Now combine them using the $y$ values:

$$P_2\left(x\right)=2L_0\left(x\right)+3L_1\left(x\right)+1L_2\left(x\right).$$

Substituting the formulas gives

$$P_2\left(x\right)=2\cdot\frac{\left(x-2\right)\left(x-4\right)}{3}+3\cdot\left(-\frac{\left(x-1\right)\left(x-4\right)}{2}\right)+\frac{\left(x-1\right)\left(x-2\right)}{6}.$$

This expression is the interpolating polynomial in Lagrange form. It is usually not necessary to expand it unless we want a standard polynomial form. In many numerical methods, the Lagrange form is already enough to evaluate values or reason about the data.

To check the interpolation property, evaluate at $x=2$:

  • $L_0\left(2\right)=0$,
  • $L_1\left(2\right)=1$,
  • $L_2\left(2\right)=0$.

So

$$P_2\left(2\right)=2\cdot 0+3\cdot 1+1\cdot 0=3,$$

which matches the data point $(2,3)$ exactly.

Why Lagrange Form Matters in Numerical Analysis

Lagrange form is important because it gives a clear theoretical answer to the interpolation problem. If the $x_i$ values are distinct, then there is exactly one polynomial of degree at most $n$ passing through the $n+1$ points. This uniqueness is a key result in Interpolation I.

In practice, Lagrange form helps in several ways:

  • It gives a direct formula for the interpolating polynomial.
  • It shows how each data point contributes to the final polynomial.
  • It is useful for proofs and theoretical analysis.
  • It helps compare interpolation methods, such as Newton divided differences.

In numerical work, one important detail is that the Lagrange formula is easy to write but can be expensive to evaluate repeatedly if many values of $x$ are needed. If the same data points are reused often, other forms may be more efficient. Still, the Lagrange form remains a foundational idea because it reveals the structure of polynomial interpolation clearly.

Another major reason it matters is error analysis. When studying interpolation, we often want to understand how far the interpolating polynomial may be from the original function. The Lagrange form is connected to the general theory of polynomial interpolation and the interpolation remainder, which helps explain approximation quality.

Connection to Interpolation I and Newton Divided Differences

Interpolation I usually begins with the polynomial interpolation problem: given data points, find a polynomial that matches them. Lagrange form is one of the main solutions.

A related method is Newton divided differences. Newton form also builds the interpolating polynomial, but it organizes the information differently. The Newton form is often better when new points are added one by one, because the polynomial can be updated more easily. Lagrange form, in contrast, gives a symmetric formula that treats all data points at once.

Both methods produce the same interpolating polynomial, because the polynomial is unique. So the difference is not in the final answer, but in the way the answer is written and computed.

That means students should think of Lagrange form as one major viewpoint inside Interpolation I:

  • Polynomial interpolation is the overall topic.
  • Lagrange form is one representation of the interpolating polynomial.
  • Newton divided differences is another representation.

Understanding all of these helps build a strong foundation for later numerical methods.

Common Features and Limitations

Lagrange form has several important features. It works only when the $x_i$ values are distinct, because the denominators $x_i-x_j$ must not be zero. It also always creates a polynomial of degree at most $n$ for $n+1$ data points.

However, interpolation is not the same as exact modeling. A polynomial can pass through the given points and still behave wildly between them if the degree is too high or the points are poorly chosen. This is a known issue in Numerical Analysis. So while the Lagrange polynomial matches the data exactly, it may or may not be the best approximation for every application.

A real-world example is using sensor measurements. If a robot records temperature at several times, the interpolating polynomial can estimate temperature between measurements. But if the data are noisy or the interval is large, a high-degree polynomial may produce unrealistic values. In such cases, other numerical methods or piecewise interpolation may be preferred.

Conclusion

The Lagrange form is a central idea in polynomial interpolation. It gives a unique polynomial that passes through given data points by combining the values $y_i$ with basis polynomials $L_i\left(x\right)$. Its defining feature is the property that each basis polynomial is $1$ at one chosen node and $0$ at all others.

students, this lesson showed how the Lagrange form fits into Interpolation I, why it is mathematically important, and how to apply it to real data. It is a strong tool for understanding how numerical methods turn scattered data into a smooth polynomial model. πŸ“˜

Study Notes

  • Interpolation means building a function that matches given data points.
  • In Lagrange form, the interpolating polynomial is written as $P_n\left(x\right)=\sum_{i=0}^{n} y_iL_i\left(x\right)$.
  • The Lagrange basis polynomial is $L_i\left(x\right)=\prod_{\substack{j=0\\ j\ne i}}^{n}\frac{x-x_j}{x_i-x_j}$.
  • The key property is $L_i\left(x_j\right)=1$ when $i=j$ and $0$ when $i\ne j$.
  • This property guarantees that $P_n\left(x_i\right)=y_i$ for every data point.
  • Lagrange form gives a unique polynomial of degree at most $n$ through $n+1$ points, assuming all $x_i$ values are distinct.
  • It is important in Interpolation I and connects directly to Newton divided differences.
  • Lagrange form is excellent for theory and understanding, but repeated evaluation can be less efficient than some other methods.
  • Interpolation matches the data exactly, but a high-degree polynomial may still behave poorly between points.
  • Understanding Lagrange form helps build a strong foundation for more advanced Numerical Analysis topics.

Practice Quiz

5 questions to test your understanding