<s>[INST] Help solving $\int {\frac{8x^4+15x^3+16x^2+22x+4}{x(x+1)^2(x^2+2)}dx}$ $\displaystyle\int {\frac{8x^4+15x^3+16x^2+22x+4}{x(x+1)^2(x^2+2)}\,\mathrm{d}x}$
I used partial fractions, solved $A = 2, C = 3$.

$$\frac{A}{x} + \frac{B}{x+1} + \frac{C}{(x+1)^2} +\frac{(Dx+E)}{(x^2+2)}$$
\begin{align*}
&8x^4+15x^3+16x^2+22x+4\\
&\quad = A(x+1)^2(x^2+2)+B(x)(x+1)(x^2+2)+C(x)(x^2+2)+(Dx+E)(x)(x+1)^2
\end{align*}
Substitute in $x=0$ to get $4=A(1)(2)$, so  $A = 2$
$$6x^4+11x^3+10x^2+14x = B(x)(x+1)(x^2+2)+C(x)(x^2+2)+(Dx+E)(x)(x+1)^2$$
Substitute in $x=-1$ to get
$$6-11+10-14 = C(-1)(1+2)$$
so $-9=-3C$, thus $C=3$.
Leaving me what I have below:

Which brings me to where I am currently stuck.
$$6x^4 +8x^3 +10x^2+8x = B(x)(x+1)(x^2+2) + (Dx + E) (x) (x+1)^2$$
Is the next best move to use substitution to solve for $B$?
 [/INST] First, I trust you used the correct partial fraction decomposition:
$$\frac{8x^4+15x^3+16x^2+22x+4}{x(x+1)^2(x^2+2)} = \frac{A}{x} + \frac{B}{x+1} + \frac{C}{(x+1)^2} + \frac{Dx+E}{x^2+2}.$$
This leads to
\begin{align*}
&8x^4 + 15x^3 + 16x^2 + 22x + 4\\
&\qquad = A(x+1)^2(x^2+2) + Bx(x+1)(x^2+2) + Cx(x^2+2) + (Dx+E)x(x+1)^2.
\end{align*}
A useful "trick" is to evaluate at the zeros of the linear factors to get some information; I suspect you evaluated at $x=0$ to get $2A = 4$, from which you got $A=2$. 
You can then evaluate at $x=-1$ to get $-3C = -9$, which is how you got $C=3$. Looking good. 
Then you used that to simplify.
$$2(x^2+2x+1)(x^2+2) +3x(x^2+2) = 2x^4 + 7x^3 + 6x^2 + 14x + 4,$$
which subtracted from $8x^4 + 15x^3 + 16x^2 + 22x + 4$ gave you
$$6x^4 + 8x^3 + 10x^2 + 8x = Bx(x+1)(x^2+2) + (Dx+E)x(x+1)^2.$$
Hmmm... Which is not quite what you have. Did you use the correct decomposition, or did you forget about being careful with that $(x+1)^2$?
Anyway: here's where you go stuck because you are used to being able to solve the partial fractions problems using only the evaluation trick. But when you have irreducible quadratic factors or powers of linear factors (or worse, both), the trick doesn't get you all the way there.
Here, we can factor out $x$ from both sides to get
$$6x^3 + 8x^2 + 10x + 8 = B(x+1)(x^2+2) + (Dx+E)(x+1)^2.$$
(We factored out $x$ from both sides and cancelled; that's how we dropped from fourth power to cube).
Edit.
We can further factor out $x+1$ from both sides:
$$(x+1)(6x^2 + 2x + 8) = (x+1)(B(x^2+2) + (Dx+E)(x+1))$$
to get
$$6x^2 + 2x + 8 = B(x^2+2) + (Dx+E)(x+1).$$
Contrary to your claim before, now that we had all the right terms, we cannot simply conclude that $D=6$, because there are two quadratic terms: $Bx^2$ and $Dx^2$. 
You can, however, evaluate at $x=-1$ to get $12 = 3B$, or $B=4$; from this you go to
$$6x^2 + 2x + 8 = 4x^2 + 8 + (Dx+E)(x+1)$$
or 
$$2x^2 + 2x = (Dx+E)(x+1).$$
Noting that the constant term on the right is $E$, and $0$ on the left, you get $E=0$. This gives
$$2x(x+1) = Dx(x+1)$$
which, cancelling $x(x+1)$ yields $D=2$.
Alternatively, from $2x^2+2x = (Dx+E)(x+1)$, we can factor the left hand side completely to get
$$2x(x+1) = (Dx+E)(x+1)$$
from which we immediately get $Dx+E = 2x$, so $D=2$ and $E=0$.
So, in summary, $A=2$, $B=4$, $C=3$, $D=2$, $E=0$. 
</s>