Solution (source code)

= Solution

Close the real segment $[-R,R]$ by an anticlockwise semicircle in the upper half-plane. For $F(z)=1/[(z^2+1)(z^2+4)]$, the <contour integral> over the arc is $O(R^{-3})$: its length is $\pi R$, whereas $|z^2+1|\geq R^2-1$ and $|z^2+4|\geq R^2-4$. The enclosed <simple poles> are $i$ and $2i$, with <residues>
$$
\operatorname{Res}_{i}F=\frac1{(2i)(i^2+4)}=\frac1{6i},\qquad
\operatorname{Res}_{2i}F=\frac1{(4i)((2i)^2+1)}=-\frac1{12i}.
$$
Letting $R\to\infty$ in the <residue theorem> yields
$$
\boxed{\int_{-\infty}^{\infty}\frac{dx}{(x^2+1)(x^2+4)}
=2\pi i\left(\frac1{6i}-\frac1{12i}\right)=\frac\pi6}.
$$