Complicated definite integral involving exponential and trig function I stumbled upon this complicated looking integral while trying to solve an assignment for extra credit in Calculus.
$$\int^\infty_0 \frac{e^{-5x}- \cos x}{x} dx$$
I tried breaking it into two parts in order to deal with each separately. I tried the only substitution that made sense to me, but got nothing. Integrating by parts still yielded no significant progress. I thought about using Gamma and Beta functions, but I can't see how to build them up in this particular case
Last thing I tried before coming here for help was Taylor series, I thought that might help me get something more familiar...
Any ideas?
 A: Let us recall the Mellin transform and its general form:

$$F(s) = \int^\infty_0 x^{s-1}f(x) dx$$

We might use this fact in this particular case, by trying to match our integral with $F(s)$. Hence, we might write:
$$\int^\infty_0 \frac{e^{-5x}- \cos x}{x} dx = \int^\infty_0 \frac{e^{-5x}}{x} dx - \int^\infty_0 \frac{\cos x}{x} dx = \int^\infty_0 x^{-1}e^{-5x}   dx - \int^\infty_0 x^{-1}\cos x\ dx.$$

You see now how the general form of the Mellin transform now encapsulates our particular case, where $s \rightarrow0$. Therefore:
$$\int^\infty_0 x^{-1}e^{-5x}   dx - \int^\infty_0 x^{-1}\cos x\ dx= \underset{s \to 0}{\lim} \{ \mathcal{Me^{-5x}}\ \}(s) - \{ \mathcal{M\cos x}\ \}(s) $$

This further yields our final answer:

$$\underset{s \to 0}{\lim} \{ \mathcal{Me^{-5x}}\ \}(s) - \{ \mathcal{M\cos x}\ \}(s) = \underset{s \to 0}{\lim}\ 5^{-s} \Gamma(s) - \Gamma(s)\cos(\frac{\pi\ s}{2}) = -\log(5).$$


For more reading on the Mellin transform, check this out.
A: Using
$$
\frac1x=\int_0^\infty e^{-tx}\,\mathrm{d}t
$$
we get
$$
\begin{align}
\int_0^\infty\frac{e^{-5x}-\cos(x)}{x}\mathrm{d}x
&=\int_0^\infty\int_0^\infty\left(e^{-5x}-\cos(x)\right)e^{-tx}\,\mathrm{d}t\,\mathrm{d}x\\
&=\int_0^\infty\int_0^\infty\left(e^{-5x}-\cos(x)\right)e^{-tx}\,\mathrm{d}x\,\mathrm{d}t\\
&=\int_0^\infty\left(\frac1{5+t}-\frac{t}{1+t^2}\right)\,\mathrm{d}t\\
&=\lim_{a\to\infty}\int_0^a\left(\frac1{5+t}-\frac{t}{1+t^2}\right)\,\mathrm{d}t\\
&=\lim_{a\to\infty}\left[\log\left(\frac{5+a}5\right)-\frac12\log\left(1+a^2\right)\right]\\
&=\lim_{a\to\infty}\frac12\log\left(\frac{25+10a+a^2}{1+a^2}\right)-\log(5)\\[6pt]
&=-\log(5)
\end{align}
$$
A: If you write your integral in the form:
$$ I=\text{Re}\int_{0}^{+\infty}\frac{e^{-5x}-e^{-ix}}{x}\,dx $$
you may just apply some version of Frullani's theorem or of the residue theorem to get:
$$ I = \color{red}{-\log 5}.$$

As an alternative, through the identity
$$ \int_{0}^{+\infty}\frac{f(x)}{x}\,dx = \int_{0}^{+\infty}\mathcal{L}(f)(s)\,ds $$
that involves the Laplace transform, the problem boils down to computing:
$$ \text{Re}\int_{0}^{+\infty}\left(\frac{1}{5+s}-\frac{1}{i+s}\right)\,ds=\int_{0}^{+\infty}\frac{1-5s}{(s+5)(s^2+1)}\,ds$$
that is straightforward.
