Lagrange Interpolation Calculator

Polynomial through points

CalculatorsFreeNo Signup
4.4(645 reviews)
All Tools

Loading tool...

About Lagrange Interpolation Calculator

A Lagrange interpolation calculator that constructs the unique polynomial of degree n−1 passing through n data points. Shows Lagrange basis polynomials Lᵢ(x), polynomial coefficients, and evaluates at any x. All calculations are client-side. Essential for numerical analysis, curve fitting, and data science.

Lagrange Interpolation Calculator Features

  • n points
  • Basis polys
  • Evaluate P(x)
  • Step-by-step
  • Add points
Lagrange interpolation: P(x) = Σ yᵢ Lᵢ(x) where Lᵢ(x) = Π(x−xⱼ)/(xᵢ−xⱼ) for j≠i. Given n points, produces unique polynomial of degree ≤ n−1. No system of equations needed — direct formula. Basis polynomials Lᵢ satisfy Lᵢ(xⱼ) = 1 if i=j, 0 otherwise.

How to Use

Enter data points:

  • Points: (x,y) pairs
  • Evaluate: P(x) at any x
  • Output: Polynomial + basis

How It Works

Each Lᵢ(x) is 1 at xᵢ and 0 at all other xⱼ. The interpolating polynomial is P(x) = y₁L₁(x) + y₂L₂(x) + ... + yₙLₙ(x).

Limitations

High-degree polynomials can oscillate wildly (Runge's phenomenon). For many points, use piecewise interpolation (splines) instead.

Step-by-Step Instructions

  1. 1Enter x-y data points.
  2. 2View basis polynomials.
  3. 3See interpolating polynomial.
  4. 4Evaluate at any x.
  5. 5Add or remove points.

Lagrange Interpolation Calculator — Frequently Asked Questions

How many points do I need?+

n points determine a unique polynomial of degree at most n−1. 2 points → line, 3 → quadratic, 4 → cubic. The polynomial always passes exactly through every given point.

What is Runge's phenomenon?+

With many equally-spaced points, high-degree interpolating polynomials can oscillate wildly between data points, especially near the edges. Using Chebyshev nodes or splines avoids this.

Is Lagrange the same as Newton interpolation?+

Both produce the same unique polynomial, just constructed differently. Lagrange uses basis polynomials (direct formula). Newton uses divided differences (incremental). Newton is easier to update when adding new points.

Share this tool: