Find the remainder when $f(x)$ divided by $(x^2 + x + 1)(x+1)$. When a polynomial $f(x)$ is divided by $x^2 + x + 1$ and $(x+1)^2$, the remainder are $x+5$ and $x-1$ respectively. Find the remainder when $f(x)$ is divided by $(x^2 + x + 1)(x+1)$.
First, I let the remainder be $Ax^2 + Bx +C$, then I try to find the values of $A$, $B$ and $C$. There is $3$ unknowns so we need three equations but I can only get two equations. 

The remainder when dividing by $(x+1)^2$ was $x-1$, so the remainder when dividing by just $x+1$ must be $-2$.
We know that $f(x)$ is of the form
$$
f(x) = q(x)(x^2 + x + 1)(x+1) + Ax^2 + Bx + C
$$
where $q(x)$ is a polynomial and $Ax^2 + Bx + C$ has the same remainders as $f$ does when divided by $x+1$ and by $x^2 + x + 1$. Now we just calculate:
$$
\frac{Ax^2 + Bx + C}{x+1} = Ax + B-A+\frac{C-B+A}{x+1}
$$
so we must have $C-B+A = -2$. That's one equation down. Now we deal with $x^2 + x + 1$:
$$
\frac{Ax^2 + Bx + C}{x^2 + x + 1} = Ax + \frac{(B-A)x + C-A}{x^2 + x + 1}
$$
so we know that $(B-A)x + C-A = x+5$. As I alluded to in the comments to the question above, this is actually two equations in one, as this is an equality of functions. The slopes must be equal, and the constant terms must be equal. This gives you the remaining two equations $B-A = 1$ and $C-A = 5$.
