<s>[INST] polynomial long division Integration $$
\int \frac{3x^2 +6x +2}{x^2 + 3x +2}dx
$$
I've been trying to solve this integral, my gut tells me to use polynomial long division so I factored and got
$$
\int \frac{3x^2 +6x +2}{(2+x)(1+x)}dx
$$
I have never done a division with two factors in the denominator, would anybody be able to help out?
 [/INST] $\int \frac{3x^2 +6x +2}{x^2 + 3x +2}dx
$
Since
$\dfrac1{x^2 + 3x +2}
=\dfrac1{(x+2)(x+1)}
=\dfrac1{x+1}-\dfrac1{x+2}
$
and
$\begin{array}\\
\dfrac{3x^2 +6x +2}{x^2 + 3x +2}
&=\dfrac{3(x^2+3x+2)-3(3x+2) +6x +2}{x^2 + 3x +2}\\
&=3-\dfrac{3x+4}{x^2 + 3x +2}\\
&=3-(3x+4)(\dfrac1{x+1}-\dfrac1{x+2})\\
&=3-\dfrac{3x+4}{x+1}-\dfrac{3x+4}{x+2}\\
&=3-\dfrac{3(x+1)+1}{x+1}+\dfrac{3(x+2)-2}{x+2}\\
&=3-3-\dfrac{1}{x+1}+3-\dfrac{2}{x+2}\\
&=3-\dfrac{1}{x+1}+\dfrac{2}{x+2}\\
\end{array}
$
and this you can
integrate by yourself.
</s>