# 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.

• Your last idea - multiplying the three factors and comparing coefficients should work. Perhaps show us your working and we can see where you went wrong? – B. Mehta May 19 '17 at 2:43
• When I multiplied everything I got x^3 - 3x^2 - x + 3. Which would mean that p = -1, q = -1, and r = 3. However when I put it into the equation I did not get 0. – Shan Lucien May 19 '17 at 2:49
• Oh nvmd I triple checked.It came to 0. My bad – Shan Lucien May 19 '17 at 2:50

By Vieta's relations between the roots $\,a=1,b=-1,c=3\,$ and coefficients $\,1,3p,q,r\,$:

• $\;\;-3p=a+b+c=1+(-1)+3=3$

• $\;\;q = ab+bc+ca=1 \cdot (-1) + (-1) \cdot 3 + 3 \cdot 1 = -1$

• $\;\;-r = abc = 1 \cdot (-1) \cdot 3 = -3$

The following polynomial has roots $1,-1$ and $3$,

$$(x+1)(x-1)(x-3)=x^3-3x^2-x+3$$ comparing to your given polynomial and equating coefficients of each power of $x$, I conclude: $$p=-1$$

$$q=-1$$

$$r=3$$

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}$

We can compare coefficients when we multiply all the roots in factor form:

\begin{align}(x-1)(x+1)(x-3) &= x^3-3x^2-x+3\\ &=x^3 + \underset{p}{3(-1)}x^2+\underset{q}{(-1)}x+\underset r{(3)}.\end{align}

We then check the roots:

1: $$(1)^3 - 3(1)^2 - 1 + 3 = 1-3-1+3 = 0$$ 3: $$(3)^3 - 3(3)^2 - 3 + 3 = 3^3 - 3^3 + 0 = 0$$

I leave it to you to check $-1$.