# Integral involving $\cos(x+\ln x)$

I recently ran across the following integrals $$I=\int_0^\infty\frac{\cos(x+\ln{x})}{x^2+1}dx$$ $$J=\int_0^\infty\frac{\sin(x+\ln{x})}{x^2+1}dx$$ They both converge according to WolframAlpha. I am curious whether there is a closed form. I tried combining these integrals while using Euler’s identity. $$I+Ji=\int_0^\infty\frac{e^{i(x+\ln{x})}}{x^2+1}dx=\int_0^\infty\frac{x^ie^{ix}}{x^2+1}$$ I wanted to use contour integration at this step, but I didn’t know how to deal with $$x^i$$ since it is a multi-valued function. For instance, $$i^i$$ is equivalent to $$e^\frac{\pi}{2}$$, $$e^\frac{3\pi}{2}$$, $$e^\frac{5\pi}{2}$$, and so on. I am not familiar with branch cuts, keyhole contours, and stuff like that.

I am willing to accept any type of answer, complex analysis or not.

• For what it's worth, contour integration shows that$$\int_{0}^{\infty} \frac{e^{i(x+ \ln x)}}{1+x^{2}} \, \mathrm dx + e^{- \pi} \int_{0}^{\infty} \frac{e^{i(-x+ \ln x)}}{1+x^{2}} \, \mathrm dx= \pi e^{-\pi/2-1}.$$ Feb 13 at 11:08
• That’s a nice result. Using that we could take the real part of both sides to get $$\int_0^\infty \frac{\cos{(x+\ln{x})}+e^{-\pi}cos{(x-\ln{x})}}{1+x^2}=\frac{\pi}{e}e^{\frac{-\pi}{2}}$$ Feb 20 at 15:01

Using a CAS, I did not get any result for $$I$$ or $$J$$ but the surprise came when I tried to compute $$(I+iJ)$$. The produced result is
$$I+i J=\frac{\text{csch}\left(\frac{\pi }{2}\right)-\text{sech}\left(\frac{\pi }{2}\right)}{4 e}\, K$$
$$K=e^{\pi } \pi -e \left(e \pi +2 i \sinh (\pi )\, \Gamma (-1+i) \,\, _1F_2\left(1;\frac{2-i}{2},\frac{3-i}{2};\frac{1}{4}\right)\right)$$
So, $$\Re(K)=\left(e^{\pi }-e^2\right) \pi-2e \sinh(\pi)\,\Re\Bigg[i \Gamma (-1+i) \, _1F_2\left(1;\frac{2-i}{2},\frac{3-i}{2};\frac{1}{4}\right) \Bigg]$$ $$\Im(K)=-2e \sinh(\pi)\,\Re\Bigg[i \Gamma (-1+i) \, _1F_2\left(1;\frac{2-i}{2},\frac{3-i}{2};\frac{1}{4}\right) \Bigg]$$
$$I=\int_0^\infty\frac{\cos(x+\ln{x})}{x^2+1}dx=\frac{\text{csch}\left(\frac{\pi }{2}\right)-\text{sech}\left(\frac{\pi }{2}\right)}{4 e}\,\Re(K)$$ $$J=\int_0^\infty\frac{\sin(x+\ln{x})}{x^2+1}dx=\frac{\text{csch}\left(\frac{\pi }{2}\right)-\text{sech}\left(\frac{\pi }{2}\right)}{4 e}\,\Im(K)$$