MAT187 L04 - Polynomial Interpolation

#MAT187 PCE
Polynomial interpolation (Lagrange interpolation) is a method of interpolating between a bunch of points by summing polynomials that intersect one specific data point, and no others. This results in a polynomial that intersects all the data points.

Lagrange interpolation method
For the data points (x1,y1),(x2,y2),,(xn1,yn1),(xn,yn), our Lagrange interpolation will follow the form:
Pn(x)=y1L1(x)+y2L2(x)++yn1Ln1(x)+ynLn(x)

...where L1(x),,Ln(x) are (n1)th degree polynomials that, for mϵ[1,n] and mϵN, fulfill Lm(xm)=1 and Ln(xc)=0, cm, cϵN.

Example
For a data set with 4 points, the formula is as follows:
Pasted image 20250201020512.png

...which is basically where the Lm(x) polynomials consist of:

Lagrange interpolation results in a function that:

Lagrange Polynomial for 3 data points:

	left=-2; right=6;
    top=5; bottom=-5;
	---
	(1,2)
	(5,4)
	(2,-3)
	y=\frac{2(x-2)(x-5)}{(1-2)(1-5)}+\frac{-3(x-1)(x-5)}{(2-1)(2-5)}+\frac{4(x-1)(x-2)}{(5-1)(5-2)}

Lagrange Polynomial for lots of data points:
Pasted image 20250201021821.png