Evaluate $\int \frac{x^2 + x + 1}{(x+1)^2(x+2)}dx$ via partial fractions $\int \frac{x^2 + x + 1}{(x+1)^2(x+2)}dx$
= $ \int \frac{Ax+B}{(x+1)} + \frac{Cx+B}{(x+1)^2} + \frac{Dx+E}{x+2}$
= $\int (Ax+B)(x+1)(x+2) + (Cx+B)(x+2) + (Dx+E)(x+1)^2$
= $ \int Ax^3 + 3Ax^2 + 2Ax + Bx^2 + 3Bx + 2B + Cx^2 + 2Cx + Bx + 2B + Dx^3 + 2Dx^2 + Dx + Ex^3 + 2Ex^2 + E$
= $ \int (A + D + E)x^3 + (3A + B + C + 2D + 2E)x^2 + (2A + 2C + 4B + D)x + (4B + E)$
Turn into matrix, find reduced row echelon form to solve system of equations:  
$\begin{bmatrix}
0 & 0 & 0 & 0 & 0 & 0 \\
1 & 0 & 0 & 1 & 1 & 0 \\
3 & 1 & 1 & 2 & 2 & 1 \\
2 & 4 & 2 & 1 & 0 & 1 \\
0 & 4 & 0 & 0 & 1 & 1 \\
\end{bmatrix}$
This is where things go wrong, apparently this doesn't reduce down properly :( and I have been relying on RREF to solve systems of equations everytime up until now.
I am also confused where the $x^2 + x + 1$ is supposed to go exactly. I know I put it into the system of equations later but until then, I feel like I kinda just ignored it and left it out of all my work up until then (is that okay?).
Other note: I recognize that this is a proper rational fraction so no long division is nesecary and that this has irreducible factors that are repeated so that is why I split them up into the partial fractions up above in that manner. Did I miss any intermittent steps that made the RREF turn out wrong? I am not sure where I went wrong thus far either

It must be $$\frac{x^2+x+1}{(x+1)^2(x+2)}=\frac{A}{x+1}+\frac{B}{(x+1)^2}+\frac{C}{x+2}$$
