\(\int\frac{xdx}{x^2+3x+2}=\frac{1}{2}\int\frac{\left(2x+3-3\right)dx}{x^2+3x+2}=\frac{1}{2}\int\frac{2x+3}{x^2+3x+2}dx-\frac{3}{2}\int\frac{dx}{x^2+3x+2}\)
\(=\frac{1}{2}\int\frac{d\left(x^2+3x+2\right)}{x^2+3x+2}-3\int\left(\frac{1}{x+1}-\frac{1}{x+2}\right)dx\)
\(=\frac{1}{2}ln\left|x^2+3x+2\right|-\frac{3}{2}ln\left|\frac{x+1}{x+2}\right|+C\)