Partial Fraction Decomposition of a Polynomial division Question :Write $$\frac{x^5}{(x^2+1 )(x+1)^2}$$ as a sum of partial fraction
What I've tried is to do polynomial long division twice to reduce the degree of numerator to be smaller than denominator than carry on to the normal steps of partial fraction decomposition 
this is what i get
$$x - 2 + \frac{1}{2x^2+2} +  \frac{2}{x+1} - \frac{1}{2(x+1)^2}$$
but i'm not sure if its correct

$$x-2+\frac{1}{2(x^2+1)}+\frac{2}{x+1}-\frac{1}{2(x+1)^2}$$
$$=\frac{2(x-2)(x^2+1)(x+1)^2+(x+1)^2+4(x^2+1)(x+1)-(x^2+1)}{2(x^2+1)(x+1)^2}$$
$$=\frac{2x^5}{2(x^2+1)(x+1)^2}=\frac{x^5}{(x^2+1)(x+1)^2}$$
So, yours is correct.
