Strange contour integral

I am interested in calculating $$\int_0^{\infty} \frac{e^{\cos(x)}\sin(\sin(x))}{x} dx$$ using the residue calculus. I thought the thing to do was to consider $$f(z) = \frac{e^{e^{iz}}}{z}$$ since $$\textrm{Im}(f(x)) = \frac{e^{\cos(x)}\sin(\sin(x))}{x}$$ and integrate on an indented semicircular contour with inner radius $$\epsilon$$, outer radius $$R$$ and let $$\epsilon \to 0, R \to \infty$$. I calculated $$\lim_{\epsilon \to 0}\int_0^{\pi} f(\epsilon e^{i\theta})i\epsilon e^{i\theta} d\theta$$ using that $$f(z) = \frac{e}{z} + O(z)$$ near $$0$$, but the problem is that the integral along the large semicircle does not vanish as $$R \to \infty$$. Actually calculating this integral seems hopeless. Any hints?

• Are you only interested in contour based approaches?
– user679268
Jul 3, 2019 at 4:36
• @KevinNivek Yes Jul 3, 2019 at 5:23
• I think the integral is diverge. Isn't $e^{\color{red}{-}\cos}$ ? Jul 3, 2019 at 5:39
• @Nosrati $\cos$ is a bounded periodic function, so that doesn't make a difference. $\sin[\sin(x)]/x$ is providing the convergence. Jul 3, 2019 at 5:52

As shown by @eyeballfrog, $$\int_0^{\infty} \frac{e^{\cos(x)}\sin(\sin(x))}{x} dx =\int_0^\pi \frac{\sin[\sin(u)]}{\sin(u)}\sin^2\left(\frac{u}{2}\right)e^{-\cos(u)}du$$

Further manipulating: \begin{align} \int_0^\pi \frac{\sin[\sin(u)]}{\sin(u)}\sin^2\left(\frac{u}{2}\right)e^{-\cos(u)}du &=\int_0^\pi \frac{\sin[\sin(u)]}{\sin(u)}\left(\frac{1-\cos u}{2}\right)e^{-\cos(u)}du \\ &=\frac12\int_{-\pi}^\pi \frac{\sin[\sin(u)]}{\sin(u)}\left(\frac{1-\cos u}{2}\right)e^{-\cos(u)}du \\ &=\frac14\Im\int_{-\pi}^\pi \frac{1-\cos u}{\sin(u)}e^{-\cos(u)+i\sin u}du \\ &=\frac14\Im\int_{-\pi}^\pi \frac{1-\cos u}{\sin(u)}\exp(-e^{-iu})du \\ &=-\frac14\Im\int_{-\pi}^\pi \frac{1-\cos u}{\sin(u)}\exp(-e^{iu})du \\ \end{align}

Let $$z=e^{iu}$$, then \begin{align} \int_0^\pi \frac{\sin[\sin(u)]}{\sin(u)}\sin^2\left(\frac{u}{2}\right)e^{-\cos(u)}du &=-\frac14\Im\int_{-\pi}^\pi \frac{2-2\cos u}{2\sin(u)}\exp(-e^{iu})du \\ &=-\frac14\Im\oint_{|z|=1} \frac{2-z-z^{-1}}{(z-z^{-1})/i}\exp(-z)\frac{dz}{iz} \\ &=\frac14\Im\oint_{|z|=1} \frac{z^2-2z+1}{z^2-1}\frac{e^{-z}}z dz\\ &=\frac14\Im\underbrace{\oint_{|z|=1} \frac{z-1}{z+1}\frac{e^{-z}}z dz}_{I}\\ \end{align}

Note that the contour integral has to be understood in the Cauchy principal value sense, since a pole lies on the path of integration.

Consider the contour $$C$$, a unit circle with a semicircle indent to the right at $$z=-1$$.

By residue theorem, $$\oint_C \frac{z-1}{z+1}\frac{e^{-z}}z dz=2\pi i\operatorname*{Res}_{z=0}\frac{z-1}{z+1}\frac{e^{-z}}z$$ $$\implies I+\int_{\text{indent}}\frac{z-1}{z+1}\frac{e^{-z}}z dz=-2\pi i$$

Since the indent is a semicircle and goes clockwisely, it is not difficult to prove that $$\int_{\text{indent}}\frac{z-1}{z+1}\frac{e^{-z}}z dz=-\frac12\cdot 2\pi i\operatorname*{Res}_{z=-1}\frac{z-1}{z+1}\frac{e^{-z}}z=-2\pi i\cdot e$$

Hence, $$I=2\pi i (e-1)$$

As a result, $$\int_0^{\infty} \frac{e^{\cos(x)}\sin(\sin(x))}{x} dx=\frac\pi 2(e-1)$$ which has been confirmed numerically.

$$\begin{multline} \int_0^\infty \frac{e^{\cos(x)}\sin[\sin(x)]}{x}dx \\ = \sum_{n=0}^\infty \left(\int_{2n\pi}^{(2n+1)\pi}\frac{e^{\cos(x)}\sin[\sin(x)]}{x}dx+\int_{(2n+1)\pi}^{2(n+1)\pi}\frac{e^{\cos(x)}\sin[\sin(x)]}{x}dx\right) \\ = \sum_{n=0}^\infty \left(\int_{0}^{\pi}\frac{e^{-\cos(u)}\sin[\sin(u)]}{(2n+1)\pi -u}du-\int_{0}^{\pi}\frac{e^{-\cos(u)}\sin[\sin(u)]}{(2n+1)\pi + u}du\right) \\ = \int_0^\pi e^{-\cos(u)}\sin[\sin(u)]\left[\sum_{n=0}^\infty \frac{2u}{(2n+1)^2\pi^2-u^2}\right]du \\ = \frac{1}{2}\int_0^\pi e^{-\cos(u)}\sin[\sin(u)]\tan\left(\frac{u}{2}\right)du = \int_0^\pi \frac{\sin[\sin(u)]}{\sin(u)}\sin^2\left(\frac{u}{2}\right)e^{-\cos(u)}du \end{multline}$$ This last integral has a bounded integrand within the domain of integration, and thus is good for numeric methods.
We can also get rather concise form of the integral using a trig transform: $$\int_0^\infty \frac{e^{\cos(x)}\sin[\sin(x)]}{x}dx = \frac{1}{2}\int_0^\pi e^{-\cos(u)}\sin[\sin(u)]\tan\left(\frac{u}{2}\right)du = \int_{-1}^1\frac{e^{-y}\sin(\sqrt{1-y^2})}{2(1+y)}dx$$ but Mathematica still doesn't want to do it analytically. It does have branch points at the ends of the interval, so perhaps this kind of contour integration could go somewhere.