<s>[INST] Cubic equation with unknown coefficients given roots I was given this equation. $x^3 + 3px^2 + qx + r=0$. The roots are $1, -1$, and $3$.
Ive tried dividing the equation by $(x-1)$ to get a quadratic to make it easier for me. But that ended up really badly. 
I also inputted the different roots into the equation to get different equations that I could solve. When I tried to prove my answer it turned out to be a flop. 
And I also tried multiplying the three factors and comparing coefficients. It didnt seem right.
 [/INST] Subbing in these roots to the equation gives us three equations.
$1 + 3p + q + r = 0$
$-1 + 3p -q + r = 0$
$27 + 27p + 3q + r = 0$
This can become a matrix equation
$\begin{bmatrix}1 \\ -1 \\ 27 \end{bmatrix} +  \begin{bmatrix}3 & 1 & 1\\3 & -1 & 1 \\27 & 3 & 1\end{bmatrix}  \begin{bmatrix}p \\ q \\ r \end{bmatrix} = \begin{bmatrix}0 \\ 0 \\ 0 \end{bmatrix} $
$\begin{bmatrix}3 & 1 & 1\\3 & -1 & 1 \\27 & 3 & 1\end{bmatrix}  \begin{bmatrix}p \\ q \\ r \end{bmatrix} = \begin{bmatrix}-1 \\ 1 \\ -27 \end{bmatrix} $
$ \begin{bmatrix}p \\ q \\ r \end{bmatrix} = \begin{bmatrix}3 & 1 & 1\\3 & -1 & 1 \\27 & 3 & 1\end{bmatrix} ^{-1} \begin{bmatrix}-1 \\ 1 \\ -27 \end{bmatrix}  = \begin{bmatrix}-1 \\ -1 \\ 3 \end{bmatrix} $
</s>