0:00 / 0:00

Polynomial Interpolation

Consider being given nn distinct points (x1,y1), , (xn,yn)(\colorOne{x_1},\colorTwo{y_1}),\ \dots,\ (\colorOne{x_n},\colorTwo{y_n}).
There is a unique interpolating polynomial which passes through all of the given points, which we can write in the form:
p(x)=r0+r1x++rn1xn1p(x)=r_0+r_1x+\cdots+r_{n-1}x^{n-1}
Plugging each given point into the form of this polynomial, we get the system of linear equations:
r0+r1x1++rn1x1n1=y1r0+r1x2++rn1x2n1=y2r0+r1xn++rn1xnn1=yn\begin{array}{ccc} r_0+r_1\colorOne{x_1}+\dots+r_{n-1}\colorOne{x_1}^{n-1} &=& \colorTwo{y_1}\\[0.8em] r_0+r_1\colorOne{x_2}+\dots+r_{n-1}\colorOne{x_2}^{n-1} &=& \colorTwo{y_2}\\ \vdots&&\vdots\\ r_0+r_1\colorOne{x_n}+\dots+r_{n-1}\colorOne{x_n}^{n-1}&=& \colorTwo{y_n} \end{array}
We have to solve this SLE to find the values of each rir_i in the interpolating polynomial.
We can do this by reducing the following augmented matrix (the coefficient matrix consists of the coefficients of the rir_i):
[1x1x1n1y11x2x2n1y21xnxnn1yn]\left[\begin{array}{cccc|c} 1 & x_1 & \cdots & x_1^{n-1} & y_1\\ 1 & x_2 & \cdots & x_2^{n-1} & y_2\\ \vdots & \vdots & \ddots & \vdots & \vdots\\ 1 & x_n & \cdots & x_n^{n-1} & y_n \end{array}\right]

PAGE BREAK

Polynomial Interpolation: Illustration

Given three points A(1,1),  B(2,2),  C(0,2)A(1,1),\ \ B(2,2),\ \ C(0,-2), find the interpolating polynomial going through all points.
3 points     \implies a polynomial of degree at most 3-1 = 2.
If we were to find the solution vector for this system, we would see that r=[r0r1r2]=[241]\vec r = \begin{bmatrix} r_0\\ r_1\\ r_2\\ \end{bmatrix} = \begin{bmatrix} -2\\ 4\\ -1\\ \end{bmatrix}.

0:00 / 0:00

Example: Polynomial Interpolation

Let's revisit the example from the lesson.
Find an interpolating polynomial for the points A(1,1),  B(2,2),  C(0,2)A(1,1),\ \ B(2,2),\ \ C(0,-2).
3 points     \implies 2nd order polynomial:
p(x)=r0+r1x+r2x2p(x) = r_0+r_1x+r_2x^2
Plugging each point into p(x)p(x) gives:
(1,1):1r0+1r1+12r2=1(2,2):1r0+2r1+22r2=2(0,2):1r0+0r1+02r2=2\begin{array}{r ccrcr cr} (\colorOne{1},\colorTwo{1}): & 1r_0&+&\colorOne{1}r_1&+&\colorOne{1}^2r_2&=&\colorTwo{1}\\[0.6em] (\colorOne{2},\colorTwo{2}):& 1r_0&+&\colorOne{2}r_1&+&\colorOne{2}^2r_2&=&\colorTwo{2}\\[0.6em] (\colorOne{0},\colorTwo{-2}):& 1r_0&+&\colorOne{0}r_1&+&\colorOne{0}^2r_2&=&\colorTwo{-2} \end{array}
We can write the augmented matrix for this linear system and reduce:
[111112421002]R1R3[100212421111]R2R1R3R1[100202440113]12R2[100201220113]R3R2[100201220011](1)R3[100201220011]R22R3[100201040011]\begin{aligned} &\left[\begin{array}{rrr|r} 1 & 1 & 1 & 1\\ 1 & 2 & 4 & 2\\ 1 & 0 & 0 & -2\\ \end{array} \right] \begin{array}{l} R_1 \leftrightarrow R_3\\ \\ \\ \end{array}\\[2.5em] \longrightarrow &\left[\begin{array}{rrr|r} 1 & 0 & 0 & -2\\ 1 & 2 & 4 & 2\\ 1 & 1 & 1 & 1\\ \end{array} \right] \begin{array}{l} \\ R_2 - R_1\\ R_3 - R_1\\ \end{array}\\[2.5em] \longrightarrow &\left[\begin{array}{rrr|r} 1 & 0 & 0 & -2\\ 0 & 2 & 4 & 4\\ 0 & 1 & 1 & 3\\ \end{array} \right] \begin{array}{l} \\ \dfrac{1}{2}R_2\\ \\ \end{array}\\[2.5em] \longrightarrow &\left[\begin{array}{rrr|r} 1 & 0 & 0 & -2\\ 0 & 1 & 2 & 2\\ 0 & 1 & 1 & 3\\ \end{array} \right] \begin{array}{l} \\ \\ R_3 - R_2\\ \end{array}\\[2.5em] \longrightarrow &\left[\begin{array}{rrr|r} 1 & 0 & 0 & -2\\ 0 & 1 & 2 & 2\\ 0 & 0 & -1 & 1\\ \end{array} \right] \begin{array}{l} \\ \\ (-1)R_3\\ \end{array}\\[2.5em] \longrightarrow &\left[\begin{array}{rrr|r} 1 & 0 & 0 & -2\\ 0 & 1 & 2 & 2\\ 0 & 0 & 1 & -1\\ \end{array} \right] \begin{array}{l} \\ R_2 - 2R_3\\ \\ \end{array}\\[2.5em] \longrightarrow &\left[\begin{array}{rrr|r} 1 & 0 & 0 & -2\\ 0 & 1 & 0 & 4\\ 0 & 0 & 1 & -1\\ \end{array} \right] \end{aligned}
Since this is in RREF, we can now read off the unique solution for the coefficients of the interpolating polynomial:
r0=2r1=4r2=1    P(x)=2+4xx2\begin{array}{rrr} r_0 &=& -2\\ r_1 &=& 4\\ r_2 &=& -1 \end{array} \quad \implies \quad P(x)=-2+4x-x^2

Find the interpolating polynomial of least degree for the data points (0,3)\left(0,-3\right), (1,1)\left(1,-1\right), and (2,5)\left(-2,5\right).

Extra Practice