Step 1

Denote the interpolating cubic polynomial by

\(\displaystyle{p}{\left({x}\right)}={a}_{{{0}}}+{a}_{{{1}}}{x}+{a}_{{{2}}}{x}^{{{2}}}+{a}_{{{3}}}{x}^{{{3}}}\)

Let's substitute the given points in the equation of the polynomial. The points \(\displaystyle{\left(-{1},-{1}\right)},{\left({0},{1}\right)},{\left({1},{3}\right)}{\quad\text{and}\quad}{\left({4},-{1}\right)}\) thus have to satisfy.

\(\displaystyle-{1}={a}_{{{0}}}-{a}_{{{1}}}+{a}_{{{2}}}-{a}_{{{3}}}\)

\(\displaystyle{1}={a}_{{{0}}}\)

\(\displaystyle{3}={a}_{{{0}}}+{a}_{{{1}}}+{a}_{{{2}}}+{a}_{{{3}}}\)

\(\displaystyle-{1}={a}_{{{0}}}+{4}{a}_{{{1}}}+{16}{a}_{{{2}}}+{64}{a}_{{{3}}}\)

First, let's substitute \(\displaystyle{a}_{{{0}}}={1}\) into the three remaining equations. That way we reduced the original system to a system of three equations with three unknowns:

\(\displaystyle-{a}_{{{1}}}+{a}_{{{2}}}-{a}_{{{3}}}=-{2}\)

\(\displaystyle{a}_{{{1}}}+{a}_{{{2}}}+{a}_{{{3}}}={2}\)

\(\displaystyle{4}{a}_{{{1}}}+{16}{a}_{{{2}}}+{64}{a}_{{{3}}}=-{2}\)

Let's solve this system using Gauss-Jordan elimination. The augmented matrix of the system is.

\(\begin{bmatrix}-1 & 1 & -1 & -2 \\1 & 1 & 1 & 2\\ 4 & 16 & 64 & -2 \end{bmatrix}\)

Step 2

Multiply the first row by -1.

\(\begin{bmatrix}1 & -1 & 1 & 2 \\1 & 1 & 1 & 2\\ 4 & 16 & 64 & -2 \end{bmatrix}\)

Add -1 times the first row to the second row, Add -4 times the first row to the third row.

\(\begin{bmatrix}1 & -1 & 1 & 2 \\0 & 2 & 0 & 0\\ 0 & 20 & 60 & -10 \end{bmatrix}\)

Multiply the second row by \(\displaystyle\frac{{1}}{{2}}\)

\(\begin{bmatrix}1 & -1 & 1 & 2 \\0 & 1 & 0 & 0\\ 0 & 20 & 60 & -10 \end{bmatrix}\)

Add -20 times the second row to the third row.

\(\begin{bmatrix}1 & -1 & 1 & 2 \\0 & 1 & 0 & 0\\ 0 & 0 & 60 & -10 \end{bmatrix}\)

Multiply the third row by \(\displaystyle\frac{{1}}{{60}}\).

\(\begin{bmatrix}1 & -1 & 1 & 2 \\0 & 1 & 0 & 0\\ 0 & 0 & 1 & -1/6 \end{bmatrix}\)

Add -1 times the third row to the first row.

\(\begin{bmatrix}1 & -1 & 0 & 13/6 \\0 & 1 & 0 & 0\\ 0 & 0 & 1 & -1/6 \end{bmatrix}\)

Add 1 times the second row to the first row.

\(\begin{bmatrix}1 & 0 & 0 & 13/6 \\0 & 1 & 0 & 0\\ 0 & 0 & 1 & -1/6 \end{bmatrix}\)

The solution is thus

\(=\frac{13}{6}, a_{2}=0,a_{3}=-\frac{1}{6}\)

Along with \(\displaystyle{a}_{{{0}}}={1}\), the interpolating polynomial is

\(\displaystyle{p}{\left({x}\right)}={1}+{\frac{{{13}}}{{{6}}}}{x}-{\frac{{{1}}}{{{6}}}}{x}^{{{3}}}\)