Numerical Analysis

Interpolation

Methods for constructing functions that pass through given data points.

Lagrange Interpolation

Theory

The Lagrange interpolating polynomial passes through all n+1 data points using basis polynomials.

P(x)=i=0nyiLi(x)P(x) = \sum_{i=0}^{n} y_i L_i(x) Li(x)=j=0,jinxxjxixjL_i(x) = \prod_{j=0, j \neq i}^{n} \frac{x - x_j}{x_i - x_j}

Each basis polynomial Li(x)L_i(x) equals 1 at xix_i and 0 at all other data points.

Data Points

P0: ,
P1: ,
P2: ,
P3: ,
P4: ,

Visualization

Polynomial Formula

P(x)=0.04(x1)(x2)(x3)(x4)+0.45x(x2)(x3)(x4)+1.85x(x1)(x3)(x4)+3.35x(x1)(x2)(x4)+2.27x(x1)(x2)(x3)P(x) = 0.04 \cdot (x - 1)(x - 2)(x - 3)(x - 4) + -0.45 \cdot x(x - 2)(x - 3)(x - 4) + 1.85 \cdot x(x - 1)(x - 3)(x - 4) + -3.35 \cdot x(x - 1)(x - 2)(x - 4) + 2.27 \cdot x(x - 1)(x - 2)(x - 3)

Practice Problems

  1. Find the Lagrange polynomial through points (0, 1), (2, 5), (3, 4). Evaluate P(1).
  2. Construct L₁(x) for points (-1, 2), (0, 1), (1, 4), (2, 3).
  3. Show that Lagrange interpolation is exact for polynomials of degree ≤ n with n+1 points.