What exactly is the following. I have never attempted to integrate something with a polynomial in the denominator.
$\displaystyle \int\frac{1}{x^2+x+2}$
First off, don't even think about it, that polynomial is irreducible on $\displaystyle \mathbb R,$ so we may find another way of solving such integral.
$\displaystyle \int{\frac{dx}{x^{2}+x+2}}=4\int{\frac{dx}{4x^{2}+ 4x+8}}=4\int{\frac{dx}{(2x+1)^{2}+7}}.$
Now put $\displaystyle 2x+1=\sqrt7\tan\varphi.$