Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

Lagrange basis polynomial

One of n+1 building-block polynomials, each equal to 1 at its own node and 0 at every other node -- combining them with the data values assembles the interpolating polynomial directly.

For nodes x_0,\ldots,x_n, the i-th Lagrange basis polynomial is L_i(x)=\prod_{j\ne i}\frac{x-x_j}{x_i-x_j}, satisfying L_i(x_i)=1 and L_i(x_j)=0 for j\ne i. The interpolating polynomial is then P(x)=\sum_{i=0}^n y_i L_i(x) -- each term contributes exactly y_i at its own node and nothing at any other, so the sum matches every data point by construction.

Examples

  • For nodes 0,1,2: L_0(x)=\dfrac{(x-1)(x-2)}{(0-1)(0-2)}, which equals 1 at x=0 and 0 at both x=1 and x=2.

Read the full section →
Graph settings

Calculator