Last modified: December 01, 2022
This article is written in: πΊπΈ
Lagrange Polynomial Interpolation
Lagrange Polynomial Interpolation is a widely used technique for determining a polynomial that passes exactly through a given set of data points. Suppose we have a set of data points where all are distinct. The aim is to find a polynomial of degree at most such that:
Instead of solving a system of linear equations (as would be required if we used a general polynomial form), Lagrange interpolation provides a direct formula for the interpolating polynomial in terms of Lagrange basis polynomials. This approach is conceptually straightforward and does not require forming and solving large linear systems.
Conceptual Illustration:
Imagine that you have three points . The Lagrange form builds a polynomial that goes exactly through these points. Each Lagrange basis polynomial is constructed to be zero at all except . By taking a suitable linear combination of these basis polynomials with weights given by , we get an interpolating polynomial .
The Lagrange polynomial passing through all these points is unique and matches every given data point exactly.
Mathematical Formulation
Given distinct points , the Lagrange interpolation polynomial is constructed as follows:
I. Lagrange Basis Polynomials:
For each in , define the -th Lagrange basis polynomial by:
Notice that , where is the Kronecker delta. In other words:
II. Lagrange Interpolating Polynomial:
Once we have the , the interpolating polynomial is given by:
By construction, for all . The degree of is at most .
Derivation
Starting from the requirement that matches all data points:
Consider polynomials defined as:
This construction ensures that for each fixed :
- When , the numerator in contains all factors for , which exactly cancel with the denominator . Thus, .
- For with , the factor in the numerator makes .
Hence acts like a "selector" polynomial that equals 1 at and 0 at every other .
To construct that passes through all points, we form:
Evaluating at :
since and for .
Algorithm Steps
I. Input:
A set of points with all distinct.
II. Initialization:
Set .
III. Compute Lagrange Basis Polynomials:
For each :
- Initialize .
- For each with :
IV. Form the Interpolating Polynomial:
Compute:
Result:
The polynomial is the desired Lagrange interpolating polynomial. To interpolate at any , just evaluate .
Example
Given Points:
Letβs consider three points:
We have (since there are 3 points), and thus the polynomial will be of degree at most 2.
Compute for the point :
Compute for the point :
Compute for the point :
Now, plug these into :
Substitute :
This polynomial will exactly fit the three given points.
Advantages
I. Exact Fit:
The Lagrange interpolation polynomial passes through all given data points exactly. There is no approximation error at these nodes.
II. No Linear System Needed:
Unlike other polynomial interpolation techniques that require solving a system of equations, Lagrange interpolation provides a direct formula.
III. Simplicity of Form:
The formula for the interpolating polynomial is explicit and easy to implement.
IV. Flexibility:
Works for any set of points with distinct .
Limitations
I. Rungeβs Phenomenon:
For a large number of interpolation points, Lagrange interpolation may cause oscillations between the points, especially if the points are unevenly spaced.
II. Recalculation for Added Points:
If a new point is added, the entire polynomial must be recomputed from scratch, unlike some other forms (e.g., Newtonβs divided differences) that allow incremental updates more easily.
III. Computational Cost:
Evaluating Lagrange polynomials directly can be computationally intensive for large due to the product terms, though this can be mitigated with more efficient evaluation strategies.