Help on evaluating $\int_{0}^{\infty}\frac{\cos\frac2x}{(x^2+4)^2}dx$ I try to integrate $I=\int_{0}^{\infty}\frac{\sin^2\frac1x}{(x^2+4)^2}dx$.
Using identity  $2\sin^2x=1-\cos(2x)$
$$I=\frac{1}{2}\int_{0}^{\infty}\frac{dx}{(x^2+4)^2}-\frac{1}{2}\int_{0}^{\infty}\frac{\cos\frac2x}{(x^2+4)^2}dx=\frac{1}{2}(I_1-I_2)$$
Using the reduction formula for
$I_1=\frac{1}{8}\int_{0}^{\infty}\frac{dx}{x^2+4}=\frac{\pi}{32}$. But, I am not sure how to evaluate
$$I_2=\int_{0}^{\infty}\frac{\cos\frac2x}{(x^2+4)^2}dx$$
Let $u=2x^{-1}$
$$I_2=\frac{1}{2}\int_{0}^{\infty}\cos(u)\cdot \frac{du}{(1+u^2)^2}=\frac{1}{2}\sum_{n=0}^{\infty}\frac{(-1)^n}{(2n)!}\int_{0}^{\infty}\frac{u^{2n}}{(1+u^2)^2}du$$
Applying the reduction formula to $$\int_{0}^{\infty}\frac{u^{2n}}{(1+u^2)^2}du=0$$
Did I evaluate $I_2$ correctly?
 A: I see two problematic points in your calculation of $I_2$.
When carrying out the substitution carefully I get:


*

*$u = \frac{2}{x} \Rightarrow \frac{du}{dx} =-\frac{2}{x^2}=-\frac{u^2}{2}$
$$I_2=\int_{0}^{\infty}\cos(2/x)\cdot \frac{dx}{(x^2+4)^2}=\int_{\infty}^{0} \frac{\cos(u)}{(\frac{4}{u^2} + 4)^2} \frac{-2du}{u^2}=\frac{1}{8}\int_{0}^{\infty} \frac{u^2\cos(u)}{(u^2 + 1)^2} du$$


Besides this you write "$\int_{0}^{\infty}\frac{u^{2n}}{(1+u^2)^2}du \color{red}{=} 0$", which cannot be, because the integrand is strictly positive.
Another possible way to show that $\color{blue}{I_2=0}$ is to use residues:


*

*Consider $\int_{0}^{\infty} \frac{u^2\cos(u)}{(u^2 + 1)^2} du = \frac{1}{2}\int_{-\infty}^{\infty} \frac{u^2\cos(u)}{(u^2 + 1)^2} du$

*$\int_{-\infty}^{\infty} \frac{u^2\cos(u)}{(u^2 + 1)^2} du = \Re \left(2\pi i Res_i \left( \frac{z^2}{(z^2 + 1)^2}e^{iz}\right) \right) = \Re \left(2\pi i Res_i \left( \frac{z^2}{(z + i)^2(z-i)^2}e^{iz}\right) \right)$
$$\color{blue}{Res_i} \left( \frac{z^2}{(z + i)^2(z-i)^2}e^{iz}\right) = \left. \left( \frac{2z(z+i)^2-z^2\cdot 2(z+i)}{(z+i)^4}e^{iz} + \frac{z^2}{(z+i)^2}\cdot ie^{iz}\right) \right|_{z=i} = \left( -\frac{i}{4} + \frac{i}{4} \right)e^{-1} \color{blue}{ = 0}$$

A: If I am not wrong, there is a small mistake since, to me,
$$I=\int\frac{\cos \left(\frac{2}{x}\right)}{\left(x^2+4\right)^2}\,dx=-\frac 18\int \frac{u^2 \cos (u)}{\left(u^2+1\right)^2}\,du$$ Using partial fraction decomposition, the antiderivative can be computed in terms of exponential integrals and, using the bounds, the result is $0$.
A: A natural way to evaluate $I$ is to enforce the substitution $x\to \frac{1}{x}$, then to invoke the Laplace transform.
$$ \int_{0}^{+\infty}\frac{\sin^2(1/x)}{(x^2+4)^2}\,dx = \int_{0}^{+\infty}\frac{\color{blue}{x^2}\color{red}{\sin^2(x)}}{\color{blue}{(4x^2+1)^2}}\,dx=\int_{0}^{+\infty}\frac{\color{blue}{\frac{1}{32}\left(s\cos(s/2)-2\sin(s/2)\right)}}{\color{red}{s(4+s^2)}}\,ds. $$
Partial fraction decomposition and the standard results $\int_{0}^{+\infty}\frac{\sin s}{s}\,ds = \int_{0}^{+\infty}\frac{1-\cos s}{s^2}\,ds = \frac{\pi}{2}$ finish the job: $ I = \frac{\pi}{64}$. The residue theorem is an excellent alternative, of course.
A: Rewrite the integral as
\begin{align}
\int_{0}^{\infty}\frac{\cos\frac2x}{(x^2+4)^2}
\overset{t=\frac2x}{ dx}&=-\frac1{16}\int_{0}^{\infty}t\cos t\ d\left(\frac{1}{t^2+1}\right)
\overset{ibp}=\frac1{16} \int_0^\infty \frac{\cos t-t\sin t}{t^2+1}dt
\end{align}
and note that
\begin{align}
J(a) &= \int_0^\infty \frac{t\sin at-\cos at}{t^2+1}dt
=\frac\pi2- \int_0^\infty \frac{\sin at +t\cos at}{t(t^2+1)}= J’(a)\ 
\end{align}
Then, with $J(0)=0$, $J(a)= J(0)e^a =0$. Thus
$$\int_{0}^{\infty}\frac{\cos\frac2x}{(x^2+4)^2}dx=\frac16 J(1)=0$$
