Lengthy integration problem $$ \int\frac{x^3+3x+2}{(x^2+1)^2(x+1)} \, dx$$
I managed to solve the problem using partial fraction decomposition.
But that approach is pretty long as it creates five variables. Is there any other shorter method to solve this problem(other than partial fractions)? 
I also tried trigonometric substitution and creating the derivative of the denominator in the numerator... but it becomes even longer. Thanks in advance!!
Just to clarify: (My partial fraction decomposition)
$$\frac{x^3+3x+2}{(x^2+1)^2(x+1)}= \frac{Ax+B}{x^2+1} + \frac{Cx+D}{(x^2+1)^2} + \frac{E}{x+1}$$

There are much better ways to find the coefficients in partial fractions than solving five equations in five variables.
Writing your function as
$$ \frac{x^3 + 3 x + 2}{(x^2+1)^2 (x+1)} = \frac{Q(x)}{(x^2+1)^2} + \frac{E}{x+1} $$
multiply both sides by $x+1$ and substitute $x=-1$.  We get
$$ \frac{-2}{2^2} = 0 + E$$
so $E = -1/2$, and 
$$ \eqalign{\frac{Q(x)}{(x^2+1)^2} &= \frac{x^3 + 3 x + 2}{(x^2+1)^2 (x+1)} + \frac{1/2}{x+1}\cr &= \frac{x^2 + 3 x + 2 + (1/2)(x^2+1)^2)}{(x^2+1)^2(x+1)}\cr
&= \frac{x^3 + x^2 + x + 5}{2(x^2 + 1)^2} }$$
Now you want this in the form
$$\frac{Ax+B}{x^2+1} + \frac{Cx+D}{(x^2+1)^2} $$
Multiply by $(x^2 + 1)^2$ and substitute $x=i$ (yes, $\sqrt{-1}$).
We get $$ 2 = C i + D $$
But since we want $C$ and $D$ to be real, we must have $C = 0$, $D = 2$.  This leaves
$$ \eqalign{\frac{Ax+B}{x^2+1} &= \frac{x^3 + x^2 + x + 5}{2(x^2 + 1)^2} - \frac{1}{(x^2+1)^2} \cr
&= \frac{x + 1}{2(x^2 + 1)}} $$
and we're done: $A = 1/2$, $B = 1/2$, $C = 0$, $D = 2$, $E = -1/2$.
