How to find the integral of a quotient of rational functions? How do I compute the following integral: $$\int \dfrac{x^4+1}{x^3+x^2}\,dx$$
My attempt:
We can write $$\dfrac{x^4+1}{x^3+x^2} = \dfrac{A}{x^2} + \dfrac{B}{x} + \dfrac{C}{x+1}$$
It is easy to find that
$A=1$,
$B=2$, and
$C=-1$.
Therefore 
$$\frac{x^4+1}{x^3+x^2} = \frac{1}{x^2} + \frac{2}{x} - \frac{1}{x+1}$$
Therefore: 
$$\int \frac{x^4+1}{x^3+x^2}\,dx = \int \frac{dx}{x^2} + \int \dfrac{2\,dx}{x} - \int \frac{dx}{x+1} = -\frac{1}{x} +2\log \vert x\vert - \log \vert x+1 \vert + C$$
The problem is I was supposed to find:  $$\int \frac{x^4+1}{x^3+x^2}\,dx = \frac{x^2}{2} - x - \frac{1}{2} - \log \vert x \vert + 2 \log \vert x+1 \vert + C$$
Where is my mistake?

Your A, B and C are wrong. Assuming your A,B and C are right, the integraiotn is right
