Where did I go wrong in applying the factor theorem? 
Given that $x + 1$ and $x - 3$ are two of the four factors of the expression $x^4 + px^3 + 5x^2 + 5x + q$, find the values of $p$ and $q$.

I tried to answer this question using the factor theorem but got the answer wrong:
$$ \text{Let } f(x) = x^4 + px^3 + 5x^2 + 5x + q $$
$$ \text{Since } x + 1 \text{ and } x - 3 \text{ are factors of } f(x), \text{ then } f(-1) = 0 \text{ and } f(3) = 0, \text{ i.e.} $$
\begin{align}
(-1)^4 + p(-1)^3 + 5(-1)^2 + 5(-1) + q &= 0 \color{red}{\leftarrow (1)} \\
(3)^4 + p(3)^3 + 5(3)^2 + 5(3) + q &= 0 \color{blue}{\leftarrow (2)}
\end{align}
$$ \text{From } \color{red}{(1)}: $$
\begin{align}
(-1)^4 + p(-1)^3 + 5(-1)^2 + 5(-1) + q &= 0 \\
1 + p(-1) + 5(1) + (-5) + q &= 0 \\
1 - p + 5 - 5 + q &= 0 \\
1 - p + q &= 0 \\
q &= p - 1 \color{limegreen}{\leftarrow (3)}
\end{align}
$$ \text{From } \color{blue}{(2)}: $$
\begin{align}
(3)^4 + p(3)^3 + 5(3)^2 + 5(3) + q &= 0 \\
81 + 27p + 45 + 15 + q &= 0 \\
27p + q + 60 + 81 &= 0 \\
27p + q + 141 &= 0 \\
q &= -27p - 144 \color{orange}{\leftarrow (4)}
\end{align}
$$ \color{orange}{(4)} + \color{limegreen}{(3)}: $$
\begin{align}
-27p - 144 &= p - 1 \\
-27p - p &= 144 - 1 \\
-28p &= 143 \\
28p &= -143 \\
p &= -\frac{143}{28} \\
\therefore p &= -5\frac{3}{28} \color{mediumpurple}{\leftarrow (5)}
\end{align}
$$ \text{Substitute } \color{mediumpurple}{(5)} \text{ into } \color{limegreen}{(3)}: $$
\begin{align}
q &= -5\frac{3}{28} - 1 \\
\therefore q &= -6\frac{3}{28}
\end{align}
The answers were $ p = -5, q = -6 $.
Where did I go wrong?
 A: Just another way.
Consider
$$y=\frac{x^4 + px^3 + 5x^2 + 5x + q } {(x+1)(x-3) }$$ and perform the long division. You will have
$$y=-\frac{q}{3}+\left(\frac{2 q}{9}-\frac{5}{3}\right) x-\left(\frac{7
   q}{27}+\frac{5}{9}\right) x^2+\frac{1}{81} x^3 (-27 p+20 q-15)+\frac{1}{243}
   x^4 (54 p-61 q-96)+\cdots$$
So,
$$-27 p+20 q-15=0$$
$$54 p-61 q-96=0$$
Solve for $(p,q)$ (simple).
A: Here is a way to see where you went wrong by comparison. Let
\begin{align*}
f(x) & = x^4+px^3 +5x^2+5x+q \\
g(x) & = (x+1)(x-3)(x-a)(x-b)
\end{align*}
Then write down the polynomial $f-g=0$. The coefficients must be all zero, i.e., we have
$$
a + b + p + 2=0,\; ab + 2a + 2b - 8=0,\;  - 2ab + 3a + 3b - 5=0, q-3ab=0.
$$
Solve for $a$ and $b$, and then put $p=-a-b-2$, $q=3ab$.
A: $$q = -27p - \color{red}{141} {\leftarrow (4)}$$
A: Your equation $4$ is not right.
It would be $ q=-27p-141 $
Then you will equate equation $4$ and $3$
$$ -27p-141=p-1 $$
You will get $p$ as $-5$.
Substitute $p$ as $-5$ in equation $3$ and we will get $q$ as $-6$
