When to use it
Newton's forward/backward formulas both require EQUALLY spaced x-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+1 points (x0,y0),(x1,y1),…,(xn,yn):
y=∑i=0nyi∏j=0j=inxi−xjx−xj
For three points, this expands to
y=y0(x0−x1)(x0−x2)(x−x1)(x−x2)+y1(x1−x0)(x1−x2)(x−x0)(x−x2)+y2(x2−x0)(x2−x1)(x−x0)(x−x1)
Worked reasoning
For the points (1,2),(3,10),(4,17), estimate y at x=2:
y=2⋅(1−3)(1−4)(2−3)(2−4)+10⋅(3−1)(3−4)(2−1)(2−4)+17⋅(4−1)(4−3)(2−1)(2−3)
=2⋅62+10⋅−2−2+17⋅3−1=32+10−317=32−17+10=−5+10=5
Each term's coefficient equals exactly 1 at its OWN xi and exactly 0 at every OTHER xj …