Answer
The cubic function is $f\left( x \right)=-{{x}^{3}}+4{{x}^{2}}-2$.
Work Step by Step
To obtain the cubic function, at first we will find the coefficients a, b, c, and d.
Since $f\left( x \right)=a{{x}^{3}}+b{{x}^{2}}+cx+d$
So, $f\left( -1 \right)=3$ gives,
$\begin{align}
& f\left( -1 \right)=a{{\left( -1 \right)}^{3}}+b{{\left( -1 \right)}^{2}}+c\left( -1 \right)+d \\
& 3=-a+b-c+d \\
& -a+b-c+d=3
\end{align}$ (I)
$f\left( 1 \right)=1$ gives,
$\begin{align}
& f\left( 1 \right)=a{{\left( 1 \right)}^{3}}+b{{\left( 1 \right)}^{2}}+c\left( 1 \right)+d \\
& 1=a+b+c+d \\
& a+b+c+d=1
\end{align}$ (II)
$f\left( 2 \right)=6$ gives,
$\begin{align}
& f\left( 2 \right)=a{{\left( 2 \right)}^{3}}+b{{\left( 2 \right)}^{2}}+c\left( 2 \right)+d \\
& 6=8a+4b+2c+d \\
& 8a+4b+2c+d=6
\end{align}$ (III)
$f\left( 3 \right)=7$ gives,
$\begin{align}
& f\left( 3 \right)=a{{\left( 3 \right)}^{3}}+b{{\left( 3 \right)}^{2}}+c\left( 3 \right)+d \\
& 7=27a+9b+3c+d \\
& 27a+9b+3c+d=7
\end{align}$ (IV)
Equations (I)–(IV) give,
$\begin{align}
& -a+b-c+d=3 \\
& a+b+c+d=1 \\
& 8a+4b+2c+d=6 \\
& 27a+9b+3c+d=7
\end{align}$
Use the Gauss elimination method to obtain the solution of the above system of equations.
The matrix corresponding to the system of equations is as follows:
$\left[ \begin{matrix}
-1 & 1 & -1 & 1 & 3 \\
1 & 1 & 1 & 1 & 1 \\
8 & 4 & 2 & 1 & 6 \\
27 & 9 & 3 & 1 & 7 \\
\end{matrix} \right]$
Find the echelon form of the matrix by using the elementary row transformation.
${{R}_{2}}\to {{R}_{2}}+{{R}_{1}},{{R}_{3}}\to {{R}_{3}}+\left( 8 \right){{R}_{1}},{{R}_{4}}\to {{R}_{4}}+\left( 27 \right){{R}_{1}}$ gives,
$\left[ \begin{matrix}
-1 & 1 & -1 & 1 & 3 \\
-1+1 & 1+1 & -1+1 & 1+1 & 3+1 \\
8+(-8) & 4+8 & 2-8 & 1+8 & 6+24 \\
27-27 & 9+27 & 3+27 & 1+27 & 7+81 \\
\end{matrix} \right]=\left[ \begin{matrix}
1 & -1 & 1 & -1 & -3 \\
0 & 2 & 0 & 2 & 4 \\
0 & 12 & -6 & 9 & 30 \\
0 & 36 & -24 & 28 & 88 \\
\end{matrix} \right]$
${{R}_{1}}\to -{{R}_{1}}$ gives,
$\left[ \begin{matrix}
-(-1) & -(1) & -(-1) & -(1) & -(3) \\
0 & 2 & 0 & 2 & 4 \\
0 & 12 & -6 & 9 & 30 \\
0 & 36 & -24 & 28 & 88 \\
\end{matrix} \right]=\left[ \begin{matrix}
1 & -1 & 1 & -1 & -3 \\
0 & 2 & 0 & 2 & 4 \\
0 & 12 & -6 & 9 & 30 \\
0 & 36 & -24 & 28 & 88 \\
\end{matrix} \right]$
${{R}_{3}}\to {{R}_{3}}+\left( -6 \right){{R}_{2}},{{R}_{4}}\to {{R}_{4}}+\left( -18 \right){{R}_{2}}$ gives,
$\left[ \begin{matrix}
1 & -1 & 1 & -1 & -3 \\
0 & 2 & 0 & 2 & 4 \\
0 & 12-12 & -6-0 & 9-12 & 30-24 \\
0 & 36-36 & -24-0 & 28-36 & 88-72 \\
\end{matrix} \right]=\left[ \begin{matrix}
1 & -1 & 1 & -1 & -3 \\
0 & 2 & 0 & 2 & 4 \\
0 & 0 & -6 & -3 & 6 \\
0 & 0 & -24 & -8 & 16 \\
\end{matrix} \right]$
${{R}_{2}}\to \frac{1}{2}{{R}_{2}}$ gives,
$\left[ \begin{matrix}
1 & -1 & 1 & -1 & -3 \\
0 & 2 & 0 & 2 & 4 \\
0 & 0 & -6 & -3 & 6 \\
0 & 0 & -24 & -8 & 16 \\
\end{matrix} \right]=\left[ \begin{matrix}
1 & -1 & 1 & -1 & -3 \\
0 & 1 & 0 & 1 & 2 \\
0 & 0 & -6 & -3 & 6 \\
0 & 0 & -24 & -8 & 16 \\
\end{matrix} \right]$
${{R}_{1}}\to {{R}_{1}}+{{R}_{2}}$ gives,
$\left[ \begin{matrix}
1 & -1+1 & 1+0 & -1+1 & -3+2 \\
0 & 1 & 0 & 1 & 2 \\
0 & 0 & -6 & -3 & 6 \\
0 & 0 & -24 & -8 & 16 \\
\end{matrix} \right]=\left[ \begin{matrix}
1 & 0 & 1 & 0 & -1 \\
0 & 1 & 0 & 1 & 2 \\
0 & 0 & -6 & -3 & 6 \\
0 & 0 & -24 & -8 & 16 \\
\end{matrix} \right]$
${{R}_{4}}\to {{R}_{4}}-4{{R}_{3}}$ gives,
$\left[ \begin{matrix}
1 & 0 & 1 & 0 & -1 \\
0 & 1 & 0 & 1 & 2 \\
0 & 0 & -6 & -3 & 6 \\
0 & 0 & -24-(-24) & -8-(-12) & 16-24 \\
\end{matrix} \right]=\left[ \begin{matrix}
1 & 0 & 1 & 0 & -1 \\
0 & 1 & 0 & 1 & 2 \\
0 & 0 & -6 & -3 & 6 \\
0 & 0 & 0 & 4 & -8 \\
\end{matrix} \right]$
${{R}_{3}}\to -\frac{1}{6}{{R}_{3}}$ gives,
$\left[ \begin{matrix}
1 & 0 & 1 & 0 & -1 \\
0 & 1 & 0 & 1 & 2 \\
0 & 0 & -\frac{6}{-6} & -\frac{3}{-6} & 6 \\
0 & 0 & 0 & 4 & -8 \\
\end{matrix} \right]=\left[ \begin{matrix}
1 & 0 & 1 & 0 & -1 \\
0 & 1 & 0 & 1 & 2 \\
0 & 0 & 1 & \frac{1}{2} & -1 \\
0 & 0 & 0 & 4 & -8 \\
\end{matrix} \right]$
${{R}_{1}}\to {{R}_{1}}-{{R}_{3}}$ gives,
$\left[ \begin{matrix}
1 & 0 & 1-1 & 0-\frac{1}{2} & -1-(-1) \\
0 & 1 & 0 & 1 & 2 \\
0 & 0 & 1 & \frac{1}{2} & -1 \\
0 & 0 & 0 & 4 & -8 \\
\end{matrix} \right]=\left[ \begin{matrix}
1 & 0 & 0 & -\frac{1}{2} & 0 \\
0 & 1 & 0 & 1 & 2 \\
0 & 0 & 1 & \frac{1}{2} & -1 \\
0 & 0 & 0 & 4 & -8 \\
\end{matrix} \right]$
${{R}_{3}}\to \frac{1}{4}{{R}_{3}}$ gives,
$\left[ \begin{matrix}
1 & 0 & 0 & -\frac{1}{2} & 0 \\
0 & 1 & 0 & 1 & 2 \\
0 & 0 & 1 & \frac{1}{2} & -1 \\
0 & 0 & 0 & \frac{4}{4} & \frac{-8}{4} \\
\end{matrix} \right]=\left[ \begin{matrix}
1 & 0 & 0 & -\frac{1}{2} & 0 \\
0 & 1 & 0 & 1 & 2 \\
0 & 0 & 1 & \frac{1}{2} & -1 \\
0 & 0 & 0 & 1 & -2 \\
\end{matrix} \right]$
${{R}_{1}}\to {{R}_{1}}+\frac{1}{2}{{R}_{4}},\,{{R}_{2}}\to {{R}_{2}}-{{R}_{4}}\,\text{ and }\,{{R}_{3}}\to {{R}_{3}}-\frac{1}{2}{{R}_{4}}$ gives,
$\left[ \begin{matrix}
1 & 0 & 0 & -\frac{1}{2}+\frac{1}{2} & 0-\frac{2}{2} \\
0 & 1 & 0 & 1-1 & 2-(-2) \\
0 & 0 & 1 & \frac{1}{2}-\frac{1}{2} & -1-(-\frac{1}{2}) \\
0 & 0 & 0 & 1 & -2 \\
\end{matrix} \right]=\left[ \begin{matrix}
1 & 0 & 0 & 0 & -1 \\
0 & 1 & 0 & 0 & 4 \\
0 & 0 & 1 & \frac{1}{2} & 0 \\
0 & 0 & 0 & 1 & -2 \\
\end{matrix} \right]$
So, $a=-1,\,b=4,\,c=0,\,\text{ and }\,d=-2$
Now, put the values of a, b, c, and d in function $f\left( x \right)=a{{x}^{3}}+b{{x}^{2}}+cx+d$. This gives:
$\begin{align}
& f\left( x \right)=\left( -1 \right){{x}^{3}}+\left( 4 \right){{x}^{2}}+\left( 0 \right)x-2 \\
& =-{{x}^{3}}+4{{x}^{2}}-2
\end{align}$
Hence, the required cubic function is: $f\left( x \right)=-{{x}^{3}}+4{{x}^{2}}-2$