Example 2. Construct a table of divided differences of various orders for the following values of $x$ and $y=f(x)$:

\[
\begin{gathered}
x_{0}=-3, x_{1}=-2, x_{2}=-1, x_{3}=1, x_{4}=2 \\
y_{0}=-9, y_{1}=-16, y_{2}=-3, y_{3}=11, y_{4}=36
\end{gathered}
\]
Solution. According to the definitions, we find the divided differences of the first order:

$$
\begin{gathered}
f\left(x_{1}, x_{0}\right)=\frac{y_{1}-y_{0}}{x_{1}-x_{0}}=\frac{-16-(-9)}{-2-(-3)}=-7 ; f\left(x_{2}, x_{1}\right)=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}=\frac{-3-(-16)}{-1-(-2)}=13 \\
f\left(x_{3}, x_{2}\right)=\frac{y_{3}-y_{2}}{x_{3}-x_{2}}=\frac{11-(-3)}{1-(-1)}=7 ; f\left(x_{4}, x_{3}\right)=\frac{y_{4}-y_{3}}{x_{4}-x_{3}}=\frac{36-11}{2-1}=25
\end{gathered}
$$

differences of the second order:

$$
\begin{aligned}
& f\left(x_{2}, x_{1}, x_{0}\right)=\frac{f\left(x_{2}, x_{1}\right)-f\left(x_{1}, x_{0}\right)}{x_{2}-x_{0}}=\frac{13-(-7)}{-1-(-3)}=10 \\
& f\left(x_{3}, x_{2}, x_{1}\right)=\frac{f\left(x_{3}, x_{2}\right)-f\left(x_{2}, x_{1}\right)}{x_{3}-x_{1}}=\frac{7-13}{1-(-2)}=-2 \\
& f\left(x_{4}, x_{3}, x_{2}\right)=\frac{f\left(x_{4}, x_{3}\right)-f\left(x_{3}, x_{2}\right)}{x_{4}-x_{2}}=\frac{25-7}{2-(-1)}=6
\end{aligned}
$$

differences of the third order:

$$
\begin{aligned}
& f\left(x_{3}, x_{2}, x_{1}, x_{0}\right)=\frac{f\left(x_{3}, x_{2}, x_{1}\right)-f\left(x_{2}, x_{1}, x_{0}\right)}{x_{3}-x_{0}}=\frac{-2-10}{1-(-3)}=-3 \\
& f\left(x_{4}, x_{3}, x_{2}, x_{1}\right)=\frac{f\left(x_{4}, x_{3}, x_{2}\right)-f\left(x_{3}, x_{2}, x_{1}\right)}{x_{4}-x_{1}}=\frac{6-(-2)}{2-(-2)}=2
\end{aligned}
$$

difference of the fourth order:

$$
f\left(x_{4}, x_{3}, x_{2}, x_{1}, x_{0}\right)=\frac{f\left(x_{4}, x_{3}, x_{2}, x_{1}\right)-f\left(x_{3}, x_{2}, x_{1}, x_{0}\right)}{x_{4}-x_{0}}=\frac{2-(-3)}{2-(-3)}=1
$$

The obtained divided differences can be represented in the form of Table 15.3.

Table 15.3

| $x$ | $y$ | Divided differences |  |  |  |
| :---: | ---: | ---: | ---: | ---: | ---: |
| -3 | -9 | -7 | 10 |  |  |
| -2 | -16 | 13 | 10 | -3 | 1 |
| -1 | -3 | 7 | -2 | 2 |  |
| 1 | 11 | 25 | 6 |  |  |
| 2 | 36 |  |  |  |  |