# Numerical Analysis/Newton form example

We'll find the interpolating polynomial passing through the points ${\displaystyle (1,-6)=(x_{0},y_{0})}$, ${\displaystyle (2,2)=(x_{1},y_{1})}$, ${\displaystyle (4,12)=(x_{2},y_{2})}$, using the Newton form of the interpolation polynomial.

The Newton form is given by the formula ${\displaystyle p(x)=\sum _{j=0}^{k}a_{j}n_{j}(x)}$, where ${\displaystyle a_{j}=[y_{0},\ldots ,y_{j}]}$ and ${\displaystyle n_{j}(x)=\prod _{i=0}^{j-1}(x-x_{i})}$, with ${\displaystyle n_{0}(x)=1}$. We start by finding each ${\displaystyle n_{j}(x)}$.

${\displaystyle n_{0}(x)=1}$

${\displaystyle n_{1}(x)=x-1}$

${\displaystyle n_{2}(x)=(x-1)(x-2)=x^{2}-3x+2}$

Next, we find the necessary divided differences. First, ${\displaystyle [y_{0}]=-6}$, ${\displaystyle [y_{1}]=2}$, and ${\displaystyle [y_{2}]=12}$. For the next level, we have:

${\displaystyle [y_{0},y_{1}]={\frac {2+6}{2-1}}=8}$

${\displaystyle [y_{1},y_{2}]={\frac {12-2}{4-2}}=5}$

Finally, we can find:

${\displaystyle [y_{0},y_{1},y_{2}]={\frac {5-8}{4-1}}=-1}$.

Now, we can find the coefficients ${\displaystyle a_{j}}$.

${\displaystyle a_{0}=[y_{0}]=-6}$

${\displaystyle a_{1}=[y_{0},y_{1}]=8}$

${\displaystyle a_{2}=[y_{0},y_{1},y_{2}]=-1}$

Substituting and simplifying, we get our interpolating polynomial:

${\displaystyle p(x)=-6+8(x-1)-(x^{2}-3x+2)=-x^{2}+11x-16}$.

Now let's add the point ${\displaystyle (3,-10)=(x_{3},y_{3})}$ to our data set and find the new polynomial using the same method. Due to the formula for the Newton form, we only have to add the term ${\displaystyle a_{3}n_{3}(x)}$ to our previous interpolating polynomial.

First, we have

${\displaystyle n_{3}(x)=(x-1)(x-2)(x-4)=x^{3}-7x^{2}+14x-8}$.

Now to find ${\displaystyle a_{3}}$ we calculate some more divided differences.

${\displaystyle [y_{3}]=-10}$

${\displaystyle [y_{2},y_{3}]={\frac {-10-12}{3-4}}=22}$

${\displaystyle [y_{1},y_{2},y_{3}]={\frac {22-5}{3-2}}=17}$

${\displaystyle a_{3}=[y_{0},\ldots ,y_{3}]={\frac {17+1}{3-1}}=9}$

So, our new interpolating polynomial is:

${\displaystyle p(x)=-x^{2}+11x-16+9(x^{3}-7x^{2}+14x-8)=9x^{3}-64x^{2}+137x-88}$.