📐 Numerical Analysis · Basis Polynomials · Curve Chart · Steps
Lagrange Calculator
Find the Lagrange interpolating polynomial through any set of data points. Get the interpolated value, basis polynomials, step-by-step solution and curve chart — instantly.
📐
Enter Data Points
Add (x, y) pairs — x values must be distinct
| Point | x value | y = f(x) |
|---|
Max 8 points | Min 2 points
Find L(x) at x =
Enter x to interpolate/extrapolate
Examples:
Interpolated Value L(x)
—
🔷 Lagrange Basis Polynomials ℓᵢ(x)
📈 Interpolation Curve
Data points
L(x) curve
Target x
📐 Step-by-Step Solution
Lagrange Interpolation — Formula & Method
Lagrange interpolation finds the unique polynomial of degree ≤ n−1 that passes through n given data points. It is one of the most fundamental methods in numerical analysis.
L(x) = Σᵢ yᵢ · ℓᵢ(x)
ℓᵢ(x) = Πj≠i (x − xⱼ) / (xᵢ − xⱼ)
where ℓᵢ(xᵢ) = 1 and ℓᵢ(xⱼ) = 0 for j ≠ i
ℓᵢ(x) = Πj≠i (x − xⱼ) / (xᵢ − xⱼ)
where ℓᵢ(xᵢ) = 1 and ℓᵢ(xⱼ) = 0 for j ≠ i
How to Use This Calculator
- Enter at least 2 data points (x, y) in the table
- All x values must be distinct (no duplicate x)
- Enter the target x value to find L(x) at that point
- Click Calculate to get interpolated value, basis polynomials and steps
- Maximum 8 data points supported
Applications of Lagrange Interpolation
- Numerical analysis: Approximating unknown functions from sample data
- Computer graphics: Smooth curve generation and animation paths
- Engineering: Data fitting, sensor calibration, signal processing
- Finance: Yield curve interpolation in bond pricing
- Physics: Estimating measurements between experimental data points
Lagrange Interpolation Examples
2 points (1,2),(3,4) → L(2) = 3.0 (linear)
3 points y=x²: (1,1),(2,4),(3,9) → L(2.5) = 6.25
4 points y=x³: (1,1),(2,8),(3,27),(4,64) → L(2.5) = 15.625
At data point: L(xᵢ) = yᵢ exactly (always passes through)
3 points y=x²: (1,1),(2,4),(3,9) → L(2.5) = 6.25
4 points y=x³: (1,1),(2,8),(3,27),(4,64) → L(2.5) = 15.625
At data point: L(xᵢ) = yᵢ exactly (always passes through)
Lagrange vs Newton Interpolation
- Lagrange: Simple formula, easy to understand. Best for small datasets. Requires full recomputation when adding a new point.
- Newton divided differences: More efficient when adding points incrementally. Same polynomial, different representation.
- Spline interpolation: Avoids Runge's phenomenon. Better for large datasets. Piecewise polynomial — not one big polynomial.
Key Properties of Lagrange Basis Polynomials
- ℓᵢ(xᵢ) = 1 — equals 1 at its own data point
- ℓᵢ(xⱼ) = 0 for j≠i — equals 0 at all other data points
- Σ ℓᵢ(x) = 1 — basis polynomials always sum to 1
- Degree of each ℓᵢ(x) = n−1 for n data points
Related Calculators
Also check our Quadratic Equation Calculator, MAD Calculator, Integer Calculator, Long Division Calculator, and all Math Calculators on CalcVelo.
Frequently Asked Questions
Lagrange interpolation constructs the unique polynomial of lowest degree that passes exactly through a given set of data points. For n points, it produces a polynomial of degree ≤ n−1. It is used to estimate values between (or beyond) known data points.
L(x) = Σ yᵢ × ℓᵢ(x) where ℓᵢ(x) = Π(x−xⱼ)/(xᵢ−xⱼ) for j≠i. Each basis polynomial ℓᵢ equals 1 at xᵢ and 0 at other points. The final polynomial is the weighted sum of basis polynomials, with yᵢ as weights.
Basis polynomials ℓᵢ(x) are building blocks of Lagrange interpolation. Each ℓᵢ equals 1 at its own point xᵢ and 0 at all other xⱼ. For 3 points: ℓ₀(x) = (x−x₁)(x−x₂)/[(x₀−x₁)(x₀−x₂)]. Multiplying by yᵢ and summing gives L(x).
Interpolation estimates within the known data range (between given points). Extrapolation estimates outside the known range. Both use Lagrange interpolation but extrapolation is less reliable — the polynomial may oscillate wildly outside the data range (Runge's phenomenon).
Main limitations: (1) Runge's phenomenon — high-degree polynomials oscillate between points. (2) Adding new data requires full recomputation. (3) Not ideal for large datasets — use spline interpolation instead. (4) Requires all x values to be distinct (no repeated x).
Minimum 2 points (gives a linear polynomial). For n points, Lagrange produces a polynomial of degree ≤ n−1. This calculator supports 2 to 8 data points. 3 points → quadratic, 4 points → cubic, 5 points → degree-4, and so on. More points = higher-degree polynomial = better fit but more oscillation risk.
Yes — by construction, L(xᵢ) = yᵢ exactly for all given data points. This is guaranteed by the basis polynomial property: ℓᵢ(xᵢ)=1 and ℓᵢ(xⱼ)=0 for j≠i. The polynomial passes through every single data point with zero error at those points. Error only occurs between the data points.
CalcVelo Lagrange Calculator — Free Lagrange Interpolation Calculator with step-by-step basis polynomials, SVG curve chart, and interpolated value. Supports 2–8 data points. No login required.