Here is the integration I want to calculate (complex analysis):
$$\int_{-\infty}^{\infty} \frac{\cos x}{x^4 + x^2 +1}$$
But I do not know how to factorize the following equation $x^4 + x^2 + 1$ to get the singularities. I first let $y = x^2$ and I used the quadratic formula to get $y = \frac{-1 \pm \sqrt{3}i}{2}$ but then what should I do to get $x$? Could someone help me please?
EDIT:
I think my professor did it using that any complex number can be written as $r e^{i \theta}$ but I do not know how he got the $\theta$, could anyone show me the solution by this method please?