Evaluating $\int_{0}^{\infty}\frac{\ln\left(x\right)\left(e^{-x}-\cos x\right)}{x}dx$

complex-analysiscontour-integration

From here after the partial fractions in the question :

$$I = \int_{0}^{\infty}\frac{\ln\left(x\right)\left(e^{-x}-\cos x\right)}{x}dx$$

I tried this via contour integration but ran into some problems with the choice of contours and the convergence of the circular arcs. I'm not sure if I need a branch cut yet, but that doesn't affect this integral. Going anticlockwise and having $z=Re^{i\theta}$ :

$$\begin{align}\int_{\Gamma}&=\int_{0}^{\pi}{\frac{\ln(Re^{i\theta})(e^{-Re^{i\theta}}-e^{iRe^{i\theta}})}{Re^{i\theta}}iRe^{i\theta}\, d\theta}\\&=i\int_{0}^{\pi}(\ln(R)+i\theta)(e^{-Re^{i\theta}}-e^{iRe^{i\theta}})\,d\theta\end{align}$$

But I don't think this converges given $R\to\infty$. Should a different contour be used or can this be continued?

Best Answer

By Frullani's theorem $$ \ln(b)=\int_{0}^{+\infty}\frac{e^{-x}-e^{-bx}}{x}\,dx \tag{1}$$ holds for any $b\in\mathbb{C}$ in the right half-plane ($\operatorname{Re}(b)>0$). Under the same assumptions, the slight generalization $$\Gamma(k)\left(1-\frac{1}{b^k}\right) = \int_{0}^{+\infty} x^k\frac{e^{-x}-e^{-bx}}{x}\,dx \tag{2} $$ holds for any $k>0$. By differentiating both sides of $(2)$ with respect to $k$, then considering the limit as $k\to 0^+$, $$ -\frac{1}{2}\ln(b)(2\gamma+\ln(b)) = \int_{0}^{+\infty}\ln(x)\frac{e^{-x}-e^{-bx}}{x}\,dx. \tag{3}$$ By considering the limit of both sides when $b$ approaches $i$ from the right half-plane we get $$ \int_{0}^{+\infty}\ln(x)\frac{e^{-x}-e^{-ix}}{x}\,dx = \frac{\pi^2}{8}-\frac{\pi i}{2}\gamma \tag{4}$$ and finally, by considering the real parts of both sides, $$ \int_{0}^{+\infty}\ln(x)\frac{e^{-x}-\cos x}{x}\,dx = \frac{\pi^2}{8}.\tag{5} $$ As usual, the properties of the (inverse) Laplace transform allow us to avoid the hunt for a suitable contour.