# Integral $\int_0^\infty \frac{x-\sin x}{x^3(x^2+4)} dx$

The following integral appeared on the $$8$$th Open Mathematical Olympiad of the Belarusian-Russian University. $$I=\int_0^\infty \frac{x-\sin x}{x^3(x^2+4)} dx$$ I used power series: $$x-\sin x = \sum_{n=1}^\infty \frac{(-1)^{n+1}x^{2n+1}}{(2n+1)!}\rightarrow I=\sum_{n=1}^\infty \frac{(-1)^{n+1}}{(2n+1)!} \int_0^\infty \frac{x^{2n-2}}{x^2+4}dx$$ Taking the inner integral and substituting $$\displaystyle{x^2=4t \rightarrow dx=\frac{dt}{\sqrt{t}}}$$ gives: $$\int_0^\infty \frac{x^{2n-2}}{x^2+4}dx=4^{n-2}\int_0^\infty \frac{t^{n-1-\frac12}}{t+1}dt$$ $$=4^{n-2} B\left(n-\frac12, 1-n+\frac12\right)=4^{n-2}\Gamma\left(n-\frac12\right)\Gamma\left(1+\frac12-n\right)$$ And using Euler's reflection formula: $$\Gamma\left(n-\frac12\right)\Gamma\left(1+\frac12-n\right)=\pi \csc\left({n\pi-\frac{\pi}{2}}\right)=-\pi\sec(n\pi)=(-1)^{n+1}\pi$$ $$I=\pi\sum_{n=1}^\infty \frac{4^{n-2}}{(2n+1)!}=\frac{\pi}{32} \sum_{n=1}^\infty \frac{2^{2n+1}}{(2n+1)!}=\frac{\pi}{32}(\sinh 2 -1)$$ I did not found the official solution, but the answer given $$\displaystyle{\frac{\pi}{32}\left(\frac{e^2-1}{e^2}\right)},\,$$ doesn't match. Can you help me find my mistake? And maybe share some different methods to solve this integral?

• Can residue calculus be used?
– MSDG
Oct 28, 2018 at 10:59
• But $\displaystyle\int_{0}^{\infty}\frac{x^{2n-2}}{x^2+4}dx$ diverges when $n>1$!!! Oct 28, 2018 at 11:03
• Residues seems like the most simple way, especially looking at the answer Oct 28, 2018 at 11:11
• The Laplace transform is another viable way. $\mathcal{L}(x-\sin x)=\frac{1}{s^2}-\frac{1}{1+s^2}$ and $\mathcal{L}^{-1}\left(\frac{1}{x^3(x^2+4)}\right)=\frac{s^2-\sin^2(s)}{8}$ reduce the original problem to the evaluation of $\int_{\mathbb{R}}\frac{\sin^2(s)\,ds}{s^2(1+s^2)}$. Oct 28, 2018 at 12:08
• Wow, this is also nice! And since $$\int_0^\infty \frac{\sin^2 x}{x^2}dx=\frac{\pi}{2}$$ This cancels out with $$\int_0^\infty \frac{x^2}{x^2(x^2+1)}dx$$ And the original integral equals to $$\frac{1}{8}\int_0^\infty \frac{\sin^2 x}{1+x^2}dx$$ And now the easiest way to evaluate it I think is to rewrite $2\sin^2 x = 1-\cos(2x).\,$Thank you! Oct 28, 2018 at 12:16

Let $$J(a)=\displaystyle\int_{0}^{\infty}\frac{ax-\sin ax}{x^3(x^2+1)}dx$$. Differentiating by $$a$$ three times (which is admissible under the integral sign, because the resulting integrals converge uniformly for $$a$$ in any finite interval), we get $$J'''(a)=\displaystyle\int_{0}^{\infty}\frac{\cos ax}{x^2+1}dx=\frac{\pi}{2}e^{-|a|}.$$ With $$J(0)=J'(0)=J''(0)=0$$ this gives $$J(a)=\dfrac{\pi}{2}\Big(1-|a|+\dfrac{a^2}{2}-e^{-|a|}\Big)\operatorname{sgn}(a)$$.
The answer is $$\dfrac{J(2)}{16}=\dfrac{\pi}{32}(1-e^{-2})$$ as expected.