Skip to content
Calcrivo

Lagrange Interpolation Calculator

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

Inputs

At least 2 distinct x values.

Corresponding y = f(x) values.

P(x)

3.25000000

Polynomial degree

3

Step by step

  1. Values used

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

  2. Lagrange formula

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

  3. P(x)

    = 3.25000000

  4. Polynomial degree

    = 3

How it works

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

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.

You might also need