<s>[INST] Solving $\int \left ( \frac{5x^2+3x-2}{x^3+2x^2} \right )$ via partial fractions I'm having issues with the Partial Fractions method:
$$\int \left ( \frac{5x^2+3x-2}{x^3+2x^2} \right )dx$$
I am doing this in a way I was taught, which somehow I feel is a bit different from other methods online.
So, first of all, we must factorize the denominator:
$$x^3+2x^2 = (x+2)\cdot x^2$$
Great. So now we write three fractions:
$$\frac{A}{x^2} + \frac{B}{x} + \frac{C}{x+2}$$
Eventually we conclude that
$$A(x+2)+B(x+2)(x)+C(x^2) = 5x^2+3x-2$$
So now we look at what happens when $x = -2$:
$$C = 12$$
When $x = 0$:
$$A = -1$$
And now we are missing $B$, but we can just pick an arbitrary number for $x$ like... $1$:
$$B = -1$$
We replace the values here:
$$\int \frac{-1}{x^2}dx + \int \frac{-1}{x}dx + \int \frac{12}{x+2}dx$$
Which results in
$$\frac{1}{x}-\ln(x)+12\ln(x+2)+K$$
But I fear the answer actually is
$$\frac{1}{x}+2\ln(x)+3\ln(x+2)+K$$
Can you tell me what did I do wrong, and what should I have done?
 [/INST] You got $A$ correct.
You have incorrectly evaluated $C$. When you sub in $x=-2$ you should get:
$$5(-2)^2+3(-2)-2=(-2)^2C$$
$$12=4C$$
$$C=3$$
Then to evaluate $B$ you can pick an arbitrary value for $x$ then solve for $B$. E.g. you selected $x=1$ this gives:
$$5\cdot1^2+3\cdot1-2=A\cdot(1+2)+B\cdot(1+2)\cdot1+C\cdot1^2$$
Replace $A$ and $C$ with the values you already found to give:
$$5+3-2=-3+3B+3$$
$$6=3B$$
$$B=2$$
</s>