You first need to express cosine as
$$\cos{x} = \frac12 (e^{i x}+e^{-i x})$$
and consider each exponential separately. For the $e^{i x}$, consider
$$\oint_{C_+} dz \frac{e^{i z}}{z^4+5 z^2+4}$$
where $C_+$ is a semicircle in the upper half plane of radius $R$, positively oriented. The contour integral is equal to
$$\int_{-R}^R dx \frac{e^{i x}}{x^4+5 x^2+4}+ i R \int_0^{\pi} d\theta \, e^{i \theta} \frac{e^{i R \cos{\theta}} e^{-R \sin{\theta}}}{R^4 e^{i 4 \theta}+ 5 R^2 e^{i 2 \theta}+4}$$
You may show that the second integral vanishes in the limit as $R \to \infty$ by showing that its magnitude is bounded by
$$\frac{2}{R^3}\int_0^{\pi/2} d\theta \, e^{-R \sin{\theta}} \le \frac{2}{R^3}\int_0^{\pi/2} d\theta \, e^{-2 R \theta/\pi} \le \frac{\pi}{R^4}$$
The contour integral is also equal to $i 2 \pi$ times the sum of the residues of the poles in the contour $C_+$. You may show that the poles of the integrand are at $z=\pm 2 i$ and $z=\pm i$, so that the poles of interest here are at $z=2 i$ and $z=i$. By the residue theorem, we have
$$\begin{align}\int_{-\infty}^{\infty} dx \frac{e^{i x}}{x^4+5 x^2+4} &= i 2 \pi \left (\frac{e^{-2}}{4 (2 i)^3 + 10 (2 i)} + \frac{e^{-1}}{4 (i)^3+10 (i)} \right )\\ &= \frac{\pi}{6 e} \left (2-\frac1{e}\right )\end{align}$$
Normally, I would say that we need to consider the other contour in the lower half plane, but because of the symmetry, we need only take the real part of the integral; hence, we are done.