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?
Method I
$x^4+x^2+1=x^4+2x^2+1-x^2=(x^2+1)^2-x^2=(x^2+x+1)(x^2-x+1)$ $=(x-a_1)(x-a_2)(x-a_3)(x-a_4)$
where $a_1,a_2,a_3,a_4$ are roots of those two quadratic equations.
Method II
Start from your $x^2=y= \frac{-1 \pm \sqrt{3}i}{2}=cos\pm\frac{2\pi}{3}+isin\pm\frac{2\pi}{3}=cos\pm\frac{4\pi}{3}+isin\pm\frac{4\pi}{3}$
Then you can get 4 $x$'s like
$x=cos\pm\frac{\pi}{3}+isin\pm\frac{\pi}{3}, cos\pm\frac{2\pi}{3}+isin\pm\frac{2\pi}{3}$