<s>[INST] How Do I Integrate? $\int \frac{-2x^{2}+6x+8}{x^{2}(x+2)}$ How do I integrate this one? $$\int \frac{-2x^{2}+6x+8}{x^{2}(x+2)}\,dx$$
Is my answer correct: $$-3\ln\left \| x+2 \right \|+\ln\left \| x \right \|+\frac{4}{x}+C$$
 [/INST] Express in partial fractions:
$$\frac{8 + 6x - 2x^{2}}{x^{2}(x + 2)} = \frac{4}{x^{2}} + \frac{1}{x} - \frac{3}{x + 2}$$
Integrate term by term:
$$\int \frac{4}{x^{2}} + \frac{1}{x} - \frac{3}{x + 2} \ \mathrm{d}x = -\frac{4}{x} + \ln{|x|} - 3\ln{|x + 2|} + C$$
So you are missing a negative sign.
</s>