As the title says I’m wondering what is wrong with my solution process in evaluating
$$\int_{0}^{\infty}\frac{\sin^2(x)}{x^2(1+x^2)}\,dx$$
Here is what I do:
$$I=\int_{0}^{\infty}\frac{\sin^2(x)}{x^2(1+x^2)}\,dx$$
Consider $$\frac{1}{x^2}=\int_{0}^{\infty}e^{-tx^2}\,dt$$
So
$$I=\int_{0}^{\infty}\int_{0}^{\infty}\frac{\sin^2(x)e^{-tx^2}}{1+x^2}\,dtdx$$
By Fubini’s theorem we can say
$$I=\int_{0}^{\infty}\int_{0}^{\infty}\frac{\sin^2(x)e^{-tx^2}}{1+x^2}\,dxdt$$
Now we will evaluate the inner integral which is
$$J=\int_{0}^{\infty}\frac{\sin^2(x)e^{-tx^2}}{x^2+1}\,dx$$
Consider
$$f(z)=\frac{(e^{iz}-e^{-iz})^2e^{-tz^2}}{4(z^2+1)}$$
Consider a semi-circular contour $C$ in the upper-half of the complex plane with a radius of $R$, and the upper curve from $R$ to $-R$ being demoted as capital gamma.
So we have
$$\oint_{C}f(z)\,dz=\int_{\Gamma}f(z)\,dz+\int_{-R}^{R}f(x)\,dx$$
Calculating the residues of $f(z)$ in the contour $C$
$$\frac{1}{4}\lim_{x\to i}(z-i)\frac{(e^{iz}-e^{-iz})^2e^{-tz^2}}{(z+i)(z-i)}$$
$$=\frac{e^t(e^{-1}-e)^2}{8i}$$
And so
$$\oint_{C}f(z)\,dz=2\pi i\sum Res(f(z))= \frac{1}{4}\pi e^t(e^{-1}-e)^2$$
So this yields
$$\int_{\Gamma}f(z)\,dz+\int_{-R}^{R}f(x)\,dx=\frac{1}{4}\pi e^t(e^{-1}-e)^2$$
And I’m the limit as R goes to infinity the Gamma integral goes to zero by Jordan’s lemma. And by symmetry of even functions we have
$$J=\int_{0}^{\infty}\frac{\sin^2(x)e^{-tx^2}}{x^2+1}\,dx=\frac{\pi}{8} e^t(e^{-1}-e)^2$$
Finally this means that
$$I=\frac{\pi}{8}(e^{-1}-e)^2\int_{0}^{\infty}e^t\,dt$$
But this is divergent.
Where did I go wrong?
Hint: if you want to evaluate the integral start by proving that: $$\int_0^\infty \cos (ax) e^{-ux^2} dx = \frac12 e^{-\frac{a^2}{2u}}$$