Having trouble integrating $ \ \ \int \frac{x^{3}+3x^{2}+2x+4}{x^{2}(x^{2}+2x+2)} dx $. I'm having trouble integrating $$\int \frac{x^{3}+3x^{2}+2x+4}{x^{2}(x^{2}+2x+2)} dx $$
My approach


*

*$ \frac{x^{3}+3x^{2}+2x+4}{x^{2}(x^{2}+2x+2)} =\frac{Ax+B}{x^{2}}+\frac{Cx+D}{x^{2}+2x+2} $ , 

*or, $ x^{3}+3x^{2}+2x+4=(Ax+B)(x^{2}+2x+2)+(Cx+D)x^{2} $ . 


But is the process right ? If not, Any suggestions are welcome.

HINT: we have $$\frac{x^3+3x^2+2x+4}{x^2(x^2+2x+2)}=-\frac{1}{x}+\frac{2}{x^2}+\frac{2x+3}{x^2+2x+2}$$
