TITLE: Evaluate the integral $ \int_{-\infty}^{\infty} {\sin ^2 (x) \over x^2 (x^2 + 1)}\:dx$
QUESTION [8 upvotes]: Can we evaluate the integral using Jordan lemma?
$$ \int_{-\infty}^{\infty} {\sin ^2 (x) \over x^2 (x^2 + 1)}\:dx$$
What de we do if removeable singularity occurs at the path of integration?

REPLY [8 votes]: Using $\sin^2(z)=\frac12(1-\cos(2z))$, you should be able to handle this in much the same way as this answer.

Details (modified from the answer mentioned above)
Since $\lim\limits_{z\to0}\frac{1-\cos(2z)}{2z^2}=1$, the singularity of the integrand near $z=0$ is removable. Therefore, since the integrand vanishes for $z$ within $\frac12$ of the real axis as $|z|\to\infty$ and there are no singularities within $\frac12$ of the real axis, the integral does not change when shifting the path of integration from $z=t$ to $z=t-\frac{i}{2}$.
Now we can break up the integral as
$$
\int_{-\infty-i/2}^{\infty-i/2}\frac{1-\cos(2z)}{2z^2(z^2+1)}\,\mathrm{d}z
=\frac14\int_{\gamma^+}\frac{1-e^{2iz}}{z^2(z^2+1)}\mathrm{d}z
+\frac14\int_{\gamma^-}\frac{1-e^{-2iz}}{z^2(z^2+1)}\mathrm{d}z\tag{1}
$$
where $\gamma^+$ and $\gamma^-$ are as depicted below:
$\hspace{4.6cm}$
$\gamma^+$ circles two singularities ($z=0$ and $z=i$) clockwise, and $\gamma^-$ circles one singularity ($z=-i$) counter-clockwise.
All of the singularities are simple, so to get the residue at $z=z_0$, we just need to multiply by $z-z_0$ and taking $\displaystyle\lim_{z\to z_0}$
At $z=0$ the residue of $\displaystyle\frac{1-e^{2iz}}{z^2(z^2+1)}$ is $-2i$
At $z=i$ the residue of $\displaystyle\frac{1-e^{2iz}}{z^2(z^2+1)}$ is $\displaystyle\frac{1-e^{-2}}{-2i}$
At $z=-i$ the residue of $\displaystyle\frac{1-e^{-2iz}}{z^2(z^2+1)}$ is $\displaystyle\frac{1-e^{-2}}{2i}$
Putting these together with $(1)$ yields
$$
\begin{align}
\int_{-\infty}^\infty\frac{1-\cos(z)}{z^2(z^2+1)}\,\mathrm{d}z
&=\frac{2\pi i}{4}\left(-2i+\frac{1-e^{-2}}{-2i}\right)-\frac{2\pi i}{4}\left(\frac{1-e^{-2}}{2i}\right)\\
&=\frac{\pi}{2}\left(2-\frac{1-e^{-2}}{2}-\frac{1-e^{-2}}{2}\right)\\
&=\frac\pi2+\frac{\pi}{2e^2}\tag{2}
\end{align}
$$