VKCMVI
COMPUTATIONAL MATHEMATICS

Lagrange interpolation

Study polynomial interpolation with distinct nodes, basis polynomials, step-by-step calculations and extrapolation diagnostics.

Calculator

Load the problem, then select Solve to view the steps. Some advanced examples intentionally fail or do not converge.

Method and applicability

Lagrange interpolation

L(x)=∑iyi∏j≠ix−xjxi−xj

Distinct x nodes define a unique polynomial of degree at most n − 1. Extrapolation and high-degree interpolation may be unreliable.

Results

Worked examples

Basic 1

(0, 0), (1, 1), (2, 4)

Expected result: L(x) = x²; L(1.5) = 2.25

Calculation steps
  1. ℓ₀(x) = (x − 1)(x − 2)/2; ℓ₁(x) = −x(x − 2); ℓ₂(x) = x(x − 1)/2
  2. L(x) = 0·ℓ₀(x) + ℓ₁(x) + 4ℓ₂(x)
  3. L(x) = −x(x − 2) + 2x(x − 1) = x²
  4. L(1.5) = 2.25

Source: Original exercise

Academic 2

(0, 0), (1, 1), (3, 2); x = 2

Expected result: L(x) = (7x − x²)/6; L(2) = 5/3

Calculation steps
  1. L(x) = −x(x − 3)/2 + x(x − 1)/3
  2. L(x) = (7x − x²)/6

Source: P. Staab · Numerical Analysis §4.2

Advanced 3

(0, 0), (1, 1), (3, 2); x = 4

Expected result: L(4) = 2

The value is outside the node interval; extrapolation is not generally reliable.

Source: Original exercise

Accuracy and common pitfalls

Barycentric evaluation is preferable to expanded coefficients, especially for large or close nodes. It does not eliminate high-degree oscillations or unreliable extrapolation.

Recommended reading

Explore the dedicated interactive interpolation tool.