TITLE: Surely You're Joking, Mr. Feynman! $\int_0^\infty\frac{\sin^2x}{x^2(1+x^2)}\,dx$
QUESTION [37 upvotes]: Prove the following
\begin{equation}\int_0^\infty\frac{\sin^2x}{x^2(1+x^2)}\,dx=\frac{\pi}{4}+\frac{\pi}{4e^2}\end{equation}

I would love to see how Mathematics SE users prove the integral preferably with the Feynman way (other methods are welcome). Thank you. (>‿◠)✌

Original question:

And of course, for the sadist with a background in differential
equations, I invite you to try your luck with the last integral of the
group.
\begin{equation}\int_0^\infty\frac{\sin^2x}{x^2(1+x^2)}\,dx\end{equation}

Source: Integration: The Feynman Way

REPLY [31 votes]: Consider 
$$
I(a)=\int_0^\infty\frac{\sin^2(ax)}{x^2(x^2+1)}dx
$$
Differentiate it twice. Since
$$
\int_0^\infty\frac{\cos(kx)}{x^2+1}dx=\frac{\pi}{2e^k}
$$
for $k>0$ we get $I''(a)=\pi e^{-2a}$. Note that $I'(0)=I(0)=0$, so after solving respective IVP we get
$$
I(a)=\frac{\pi}{4}(-1+2a+e^{-2a})
$$
Now it only remains to substitute for $a=1$.