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

Below I show how the Heaviside cover-up method generalizes to handle nonlinear denominators. With numerator $\rm\:f(x)\ =\ 8x^4+15x^3+16x^2+22x+4\:,\: $ the undetermined partial fraction is
$$\rm\frac{f(x)}{x(x+1)^2(x^2+2)}\ =\ \frac{a}{x}\, + \,\frac{b\, (x+1) + c}{(x+1)^2}\, + \,\frac{d\, x+e}{x^2+2}$$
To find $\,\rm d\,x+e\,$ in the $\rm\: x^2+2\ $ fraction, clear denominators and collect factors of $\rm\: x^2 + 2\: $
$$\rm f(x)\ \ =\ \ x\ (x+1)^2\ (d\, x +\: e)\, +\, (x^2+2)\ g(x)\ ,\quad some\ \ g(x) \in \mathbb Q[x]$$
Evaluating this $\rm\bmod\, x^2 + 2,\ $ i.e.$\:$ iteratively applying the rewrite rule $\rm\ x^2 \to -2\,\ $ yields
$$\rm - 8\, x + 4\ =\: -(4\, d + e)\, x\, +\, 2\, d - 4\, e\ \iff \ d=2,\ e=0 $$
Notice this method amounts to ignoring ("covering") all the undetermined partial fractions having denominator different (i.e. coprime) from the current denominator $\rm\:p(x) = x^2+2\:$ (i.e. having different roots) then evaluating what remains at the roots of $\rm\,p(x)\,$ or,  equivalently,  evaluating it $\rm\bmod p(x).\,$ To avoid computing inverses $\rm\bmod p(x)\:$ we scale to clear denominators before evaluating. This is simply the higher-degree analog of the classical Heaviside method - where covering up and evaluating at $\rm\: x = r\:$ is equivalent to evaluating modulo $\rm\:x-r\:$.
Using the same method we can solve for the numerator of the $\rm\ (x+1)^2\,$ fraction
$$\rm f(x)\  =\  x\, (x^2+2)\, (b\, (x+1) + c)\,  + \, (x+1)^2\ h(x)\ ,\quad some\ \ h(x) \in\mathbb Q[x]$$
Evaluating it mod $\rm\, (x+1)^2,\, $ i.e.  iteratively applying rewrite rule $\rm\, x^2 \to\, -2\ x - 1\, $ yields
$$\rm 3\ x - 6\ =\ (5\, c - 3\, b)\, x\, +\, 2\, c - 3\, b\ \iff\ c = 3,\ b = 4 $$
