Evaluate $\int \frac{x^3+4x^2+x-1}{x^3+x^2}dx$ Evaluate $\int \frac{x^3+4x^2+x-1}{x^3+x^2}dx$.
Where do I start with this integral? I can easily see that it is possible to fator $x^{2}$ out on the denominator and use partial fractions. The numerator is also factorable but it does not have any integer roots. Can someone show me how to integrate this (either using what I said about partial fractions), or another method? Thanks
 A: Simplify step by step:
$$\begin{align}
\int \frac{x^3+4x^2+x-1}{x^3+x^2}dx 
&= \int 1+ \frac{3x^2+x-1}{x^3+x^2}dx \\
&= x + \int\left(\frac{3x^2 + 2x}{x^3+x^2} -\frac{x + 1}{x^3+x^2}\right)dx \\
&= x + \int\frac{3x^2 + 2x}{x^3+x^2}dx - \int\frac{x + 1}{x^3+x^2}dx \\
&= x + \ln|x^3+x^2| - \int\frac{1}{x^2}dx \\
&= x+\ln|x^3 + x^2| + \frac{1}{x}+C
\end{align}$$
A: \begin{align}
\frac{x^3+4x^2+x-1}{x^3+x^2}
&= \frac{\color{red}{x^3 + x^2} + 3x^2+x-1}{x^3+x^2} \\
&= \color{red}{1} + \frac{3x^2+x-1}{x^3+x^2} \\
\end{align}
Now notice that the derivative of the denominator is almost the numerator (but not quite). But let's start with:
\begin{align}
\int \frac{3x^2+x-1}{x^3+x^2}dx 
&= \int\frac{3x^2+2x}{x^3+x^2} - \frac{x+1}{x^3+x^2}dx \\
&= \ln\left( x^3 + x^2 \right) - \int \frac{\cancel{x+1}}{x^2\cancel{(x+1)}} dx
\end{align}
That's a scattered answer, but it has all the ingredients.
A: Using partial fractions:
$$\frac{x^3+4x^2 +x-1 }{x^3 +x^2} =  \frac ax +\frac{b}{x^2} +\frac{c}{x+1}+d  \\ \implies x^3 +4x^2 +x-1 = ax(x+1) +b(x+1) +cx^2 +dx^2(x+1)$$ Put $x=0$ to get $b=-1$ and put $x=-1$ to get $c=1$. Then, compare the coefficient of $x^3$ to get $d=1$ and then that of $x^2$ to get $ a=2$.
All in all, this integrates to $$2\ln|x| +\frac 1x +\ln|x+1|+x +C $$
