Lagrange interpolation offers a simple and systematic way to construct an interpolation polynomial that passes through a given set of points. Given \( (n+1) \) collocation points \((x_i, f(x_i))\) for \( i = 0, 1, 2, \dots, n \), we seek a polynomial \( L(x) \) of degree ≤ \( n \) satisfying:
🔹 The Lagrange Basis Polynomials
Suppose we can construct \( (n+1) \) polynomials \( L_i(x) \) of degree \( n \) such that:
\[ L_i(x_i) = 1 \quad \text{and} \quad L_i(x_j) = 0 \quad \forall j \ne i \]
Then, the interpolation polynomial is defined by:
\[ L(x) = \sum_{i=0}^{n} f(x_i)\,L_i(x) \]
Each \( L_i(x) \) is of degree \( n \), and it can be shown that \( L(x) \) passes through all collocation points:
\[ L(x_j) = f(x_j)L_j(x_j) + \sum_{i \ne j} f(x_i)L_i(x_j) = f(x_j) + 0 = f(x_j) \]
Hence, \( L(x) \) is the unique interpolation polynomial passing through the given points.
🔹 Case of Degree 1 (Linear Interpolation)
Consider two points \((x_0, f(x_0))\) and \((x_1, f(x_1))\). We want two first-degree basis polynomials \( L_0(x) \) and \( L_1(x) \) such that:
\[ L_0(x_0) = 1, \quad L_0(x_1) = 0 \quad ; \quad L_1(x_0) = 0, \quad L_1(x_1) = 1 \]
To make \( L_0(x) \) vanish at \( x = x_1 \), we can start from the term \( (x - x_1) \), but it must also equal 1 when \( x = x_0 \). Thus:
\[ L_0(x) = \frac{x - x_1}{x_0 - x_1} \]
Similarly, for \( L_1(x) \):
\[ L_1(x) = \frac{x - x_0}{x_1 - x_0} \]
The linear interpolation polynomial is therefore:
\[ p_1(x) = f(x_0)L_0(x) + f(x_1)L_1(x) \]
🔹 Example: Line Through Two Points
Find the equation of the line passing through the points \( (2, 3) \) and \( (5, -6) \).
\[ p_1(x) = 3 \cdot \frac{x - 5}{2 - 5} + (-6) \cdot \frac{x - 2}{5 - 2} \]
\[ p_1(x) = - (x - 5) - 2(x - 2) = -3x + 9 \]
Thus, the interpolating line is \( p_1(x) = -3x + 9 \).
📝 Summary
- Lagrange interpolation builds an exact polynomial passing through all known points.
- The basis functions \( L_i(x) \) are constructed to be 1 at \( x_i \) and 0 at other nodes.
- The resulting polynomial \( L(x) = \sum f(x_i)L_i(x) \) is unique and simple to evaluate.
- For \( n = 1 \), it corresponds to the familiar linear interpolation used in many engineering contexts.
