Integral representation for Euler constant

Taking integration by parts (IbP) twice, we obtain

\begin{align*} \int_{0}^{\infty} \frac{\log(1+x) + e^{-x} - 1}{x^2} \, dx &\stackrel{\text{(IbP)}}{=} \int_{0}^{\infty} \left( \frac{1}{x+1} - e^{-x} \right) \frac{1}{x} \, dx \\ &\stackrel{\text{(IbP)}}{=} \int_{0}^{\infty} \left( \frac{1}{(x+1)^2} - e^{-x} \right) \log x \, dx. \end{align*}

But it is easy to check that

$$ \int_{0}^{\infty} \frac{\log x}{(1+x)^2} \, dx \stackrel{(x\ \mapsto\ \frac{1}{x})}{=} -\int_{0}^{\infty} \frac{\log x}{(1+x)^2} \, dx $$

and hence the common value of both sides is zero. For the remaining term, it is well-known that

$$ \int_{0}^{\infty} e^{-x}\log x \, dx = -\gamma. $$

This particular integral has been explained several times in this community. (See this, for instance.)

Tags:

Integration