Skip to content

Business Mathematics and Statistics · Ch 5 — Numerical Methods (Finite Differences, Interpolation)

Lagrange's Interpolation Formula

4

Lagrange's Interpolation Formula

When to use it

Newton's forward/backward formulas both require EQUALLY spaced xx-values. Lagrange's interpolation formula removes that restriction entirely — it works for ANY set of distinct data points, equally spaced or not.

The formula

For n+1n+1 points (x0,y0),(x1,y1),…,(xn,yn)(x_0,y_0),(x_1,y_1),\dots,(x_n,y_n):

y=∑i=0nyi∏j=0j≠inx−xjxi−xjy=\sum_{i=0}^{n}y_i\prod_{\substack{j=0\\j\neq i}}^{n}\frac{x-x_j}{x_i-x_j}

For three points, this expands to

y=y0(x−x1)(x−x2)(x0−x1)(x0−x2)+y1(x−x0)(x−x2)(x1−x0)(x1−x2)+y2(x−x0)(x−x1)(x2−x0)(x2−x1)y=y_0\frac{(x-x_1)(x-x_2)}{(x_0-x_1)(x_0-x_2)}+y_1\frac{(x-x_0)(x-x_2)}{(x_1-x_0)(x_1-x_2)}+y_2\frac{(x-x_0)(x-x_1)}{(x_2-x_0)(x_2-x_1)}

Worked reasoning

For the points (1,2),(3,10),(4,17)(1,2),(3,10),(4,17), estimate yy at x=2x=2:

y=2⋅(2−3)(2−4)(1−3)(1−4)+10⋅(2−1)(2−4)(3−1)(3−4)+17⋅(2−1)(2−3)(4−1)(4−3)y=2\cdot\frac{(2-3)(2-4)}{(1-3)(1-4)}+10\cdot\frac{(2-1)(2-4)}{(3-1)(3-4)}+17\cdot\frac{(2-1)(2-3)}{(4-1)(4-3)}

=2⋅26+10⋅−2−2+17⋅−13=23+10−173=2−173+10=−5+10=5=2\cdot\frac{2}{6}+10\cdot\frac{-2}{-2}+17\cdot\frac{-1}{3}=\frac23+10-\frac{17}3=\frac{2-17}3+10=-5+10=5

Note

Each term's coefficient equals exactly 1 at its OWN xix_i and exactly 0 at every OTHER xjx_j …

Definition 1Lagrange's Interpolation Formula

y=∑yi∏j≠ix−xjxi−xjy=\sum y_i\prod_{j\neq i}\frac{x-x_j}{x_i-x_j}, applicable to ANY set of distinct data points, whether equally spaced or not — unlike Newton's …