TITLE: Best way to integrate $ \int_0^\infty \frac{e^{-at} - e^{-bt}}{t} \text{d}t $
QUESTION [15 upvotes]: Today I had an exam and I mixed up the integration by parts formula. 
The question was to integrate
$$ \int\nolimits_0^\infty \frac{e^{-at} - e^{-bt}}{t} \text{d}t $$
I will try solve this again with the right formula when I arrive home. I would appreciate if somebody could tell me the solution so I can double check and maybe give a hint to another way of solving this instead of integration by parts (if possible).

REPLY [6 votes]: By differentiating under the integral sign. Fix $a$, and let
$$
g(b) = \int_{0}^\infty \frac{e^{-at} - e^{-bt}}{t} dt.
$$
Differentiating w.r.t. $b$, we get
$$
g'(b) = \frac{d}{db}\int_{0}^\infty \frac{e^{-at} - e^{-bt}}{t} dt = \int_{0}^{\infty} \frac{\partial}{\partial b} \frac{e^{-at} - e^{-bt}}{t} dt.
$$
Doing the differentiation,
$$
g'(b) = \int_{0}^{\infty} e^{-bt} dt = - \left.\frac{e^{-bt}}{b} \right|_{0}^{\infty} = \frac{1}{b}.
$$
Thus we must have $g(b) = \ln b + C$ for some constant $C$. To determine $C$, plug in $a$, and use the fact that $g(a) = 0$.
Note. I am yet to convince myself that all the steps of the proof are rigorous. I will edit my answer later if additional argument is necessary.