Show

$$\int_0^\infty \frac{\cos x}{1+x^2}dx=\frac{1}{2}\frac{\pi}{e}$$

So The only poles are at $i$ and $-i$ which is not in $(0,\infty)$, should I write $\cos x = \frac{e^{ix}+e^{-ix}}{2}$ I know there is a non brut force way using complex but what's my $f$ , do I factor the denominator into $(x+i)(x-i)$ what's the step?