Skip to content
ENExplore Calculators

Lagrange Interpolation Calculator

Construct the Lagrange interpolating polynomial through given data points and evaluate at x.

About Lagrange Interpolation Calculator

Lagrange interpolation constructs the unique polynomial of degree ≤ n-1 passing through n data points. It uses the formula P(x) = Σ yᵢ·Lᵢ(x) where each basis polynomial Lᵢ(x) = Π_{j≠i} (x-xⱼ)/(xᵢ-xⱼ) equals 1 at xᵢ and 0 at all other data points. Enter x and y values as comma-separated lists.

Formula

Lagrange formula

P(x) = Σᵢ yᵢ · Πⱼ≠ᵢ (x - xⱼ)/(xᵢ - xⱼ)

P(x)
Interpolating polynomial at x
(xᵢ,yᵢ)
Data points
Lᵢ(x)
i-th Lagrange basis polynomial

Worked example

With the default values below, Lagrange Interpolation Calculator returns P(x) of 3.25000000. Change any input above and every figure here is recalculated in your browser.

Inputs used

x values (comma-separated)
0, 1, 2, 3
y values (comma-separated)
1, 2, 5, 10
Evaluate at x
1.5

Results

P(x)
3.25000000
Polynomial degree
3

Step by step

  1. 1Values used
  2. 2Lagrange formula
  3. 3P(x)= 3.25000000
  4. 4Polynomial degree= 3

Assumptions and limits

  • The result is derived only from the 3 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to 8 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

What is Runge's phenomenon?

With many equally-spaced points, high-degree polynomials can oscillate wildly between points. Use Chebyshev nodes or splines for many data points.

How many points do I need?

n points determine a unique polynomial of degree n-1. More points give higher-degree polynomials but risk oscillation.

Lagrange Interpolation Calculator | Calcrivo