We have the following problem given: $$ \int_{-\infty}^\infty \frac{\cos(t)^2}{t^4 + 5 t^2 + 4} \, \mathrm dt. $$
I thought that I could solve it using the residue theorem and by arguing that the integral along the great upper semicircle vanishes.
Mathematica gave me the following solution to that integral: $$ \frac{(-1+2 \mathrm e^2+\mathrm e^4) \pi }{12 \mathrm e^4} \approx 0.327866. $$
The poles of the integrand are at $\pm \mathrm i$ and $\pm 2 \mathrm i$. If I choose the upper great semicircle, I would go round the poles $\mathrm i$ and $2 \mathrm i$ once in positive direction.
We then calculated the residues by using this formula for first-order singularities: $$ \mathop{\mathrm{Res}}_{z_0} f = \lim_{z \to z_0} (z-z_0) \, f(z). $$
Those came out right (compared to Mathematica) as of $$ \mathop{\mathrm{Res}}_{\mathrm i} f = -\frac{1}{6} \mathrm i \cosh ^2(1) ,\quad \mathop{\mathrm{Res}}_{2 \mathrm i} f = \frac{1}{12} \mathrm i \cosh ^2(2) $$
However, if I add both of them and multiply with $2 \pi \mathrm i$, I get a different result ($\approx -4.9176$), which I do not really understand. Is the part along the great semicirle not negligible? If not, how are we supposed to solve this problem?