We'll find the interpolating polynomial passing through the points
(
1
,
−
6
)
=
(
x
0
,
y
0
)
{\displaystyle (1,-6)=(x_{0},y_{0})}
,
(
2
,
2
)
=
(
x
1
,
y
1
)
{\displaystyle (2,2)=(x_{1},y_{1})}
,
(
4
,
12
)
=
(
x
2
,
y
2
)
{\displaystyle (4,12)=(x_{2},y_{2})}
, using the Newton form of the interpolation polynomial.
The Newton form is given by the formula
p
(
x
)
=
∑
j
=
0
k
a
j
n
j
(
x
)
{\displaystyle p(x)=\sum _{j=0}^{k}a_{j}n_{j}(x)}
, where
a
j
=
[
y
0
,
…
,
y
j
]
{\displaystyle a_{j}=[y_{0},\ldots ,y_{j}]}
and
n
j
(
x
)
=
∏
i
=
0
j
−
1
(
x
−
x
i
)
{\displaystyle n_{j}(x)=\prod _{i=0}^{j-1}(x-x_{i})}
, with
n
0
(
x
)
=
1
{\displaystyle n_{0}(x)=1}
. We start by finding each
n
j
(
x
)
{\displaystyle n_{j}(x)}
.
n
0
(
x
)
=
1
{\displaystyle n_{0}(x)=1}
n
1
(
x
)
=
x
−
1
{\displaystyle n_{1}(x)=x-1}
n
2
(
x
)
=
(
x
−
1
)
(
x
−
2
)
=
x
2
−
3
x
+
2
{\displaystyle n_{2}(x)=(x-1)(x-2)=x^{2}-3x+2}
Next, we find the necessary divided differences . First,
[
y
0
]
=
−
6
{\displaystyle [y_{0}]=-6}
,
[
y
1
]
=
2
{\displaystyle [y_{1}]=2}
, and
[
y
2
]
=
12
{\displaystyle [y_{2}]=12}
. For the next level, we have:
[
y
0
,
y
1
]
=
2
+
6
2
−
1
=
8
{\displaystyle [y_{0},y_{1}]={\frac {2+6}{2-1}}=8}
[
y
1
,
y
2
]
=
12
−
2
4
−
2
=
5
{\displaystyle [y_{1},y_{2}]={\frac {12-2}{4-2}}=5}
Finally, we can find:
[
y
0
,
y
1
,
y
2
]
=
5
−
8
4
−
1
=
−
1
{\displaystyle [y_{0},y_{1},y_{2}]={\frac {5-8}{4-1}}=-1}
.
Now, we can find the coefficients
a
j
{\displaystyle a_{j}}
.
a
0
=
[
y
0
]
=
−
6
{\displaystyle a_{0}=[y_{0}]=-6}
a
1
=
[
y
0
,
y
1
]
=
8
{\displaystyle a_{1}=[y_{0},y_{1}]=8}
a
2
=
[
y
0
,
y
1
,
y
2
]
=
−
1
{\displaystyle a_{2}=[y_{0},y_{1},y_{2}]=-1}
Substituting and simplifying, we get our interpolating polynomial:
p
(
x
)
=
−
6
+
8
(
x
−
1
)
−
(
x
2
−
3
x
+
2
)
=
−
x
2
+
11
x
−
16
{\displaystyle p(x)=-6+8(x-1)-(x^{2}-3x+2)=-x^{2}+11x-16}
.
Now let's add the point
(
3
,
−
10
)
=
(
x
3
,
y
3
)
{\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
a
3
n
3
(
x
)
{\displaystyle a_{3}n_{3}(x)}
to our previous interpolating polynomial.
First, we have
n
3
(
x
)
=
(
x
−
1
)
(
x
−
2
)
(
x
−
4
)
=
x
3
−
7
x
2
+
14
x
−
8
{\displaystyle n_{3}(x)=(x-1)(x-2)(x-4)=x^{3}-7x^{2}+14x-8}
.
Now to find
a
3
{\displaystyle a_{3}}
we calculate some more divided differences.
[
y
3
]
=
−
10
{\displaystyle [y_{3}]=-10}
[
y
2
,
y
3
]
=
−
10
−
12
3
−
4
=
22
{\displaystyle [y_{2},y_{3}]={\frac {-10-12}{3-4}}=22}
[
y
1
,
y
2
,
y
3
]
=
22
−
5
3
−
2
=
17
{\displaystyle [y_{1},y_{2},y_{3}]={\frac {22-5}{3-2}}=17}
a
3
=
[
y
0
,
…
,
y
3
]
=
17
+
1
3
−
1
=
9
{\displaystyle a_{3}=[y_{0},\ldots ,y_{3}]={\frac {17+1}{3-1}}=9}
So, our new interpolating polynomial is:
p
(
x
)
=
−
x
2
+
11
x
−
16
+
9
(
x
3
−
7
x
2
+
14
x
−
8
)
=
9
x
3
−
64
x
2
+
137
x
−
88
{\displaystyle p(x)=-x^{2}+11x-16+9(x^{3}-7x^{2}+14x-8)=9x^{3}-64x^{2}+137x-88}
.