Integral representation for Euler constant I am trying to show that $$\gamma=\int_0^{\infty}\frac{\ln(1+x)+e^{-x}-1}{x^2}\;dx$$ I haven't done so much, but since this is related to $\psi (1)=\Gamma'(1)$ I have tried to work backwards. So $$\Gamma(x)=\int_0^{\infty} t^{x-1}e^{-t}\;dt\rightarrow \Gamma'(x)=\int_0^{\infty} t^{x-1}e^{-t}\ln t\;dt$$ $$\int_0^{1} t^{x-1}e^{-t}\ln t\;dt+\int_0^{1} \frac{e^{-\frac{1}{t}}\ln t}{t^2}\;dt$$ Where I used $t=\frac{1}{t}$ in the second integral, I also tried to recombine those two, but of no use. Also this is equal to: $$\int_0^{\infty} (\ln\left(1+\frac{1}{x}\right)+e^{-\frac{1}{x}}-1)dx$$ Now I am thinking to use series. Could you give me some help or hints?
 A: 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.)
A: Hint:
we have that
$$
\eqalign{
  & I(a,b) = \int_{\,x\, = \,a}^{\;b} {{{\ln \left( {1 + x} \right) + e^{\, - x}  - 1} \over {x^{\,2} }}dx}  =   \cr 
  &  =  - \int_{\,x\, = \,a}^{\;b} {\ln \left( {1 + x} \right)d\left( {1/x} \right)}  + \int_{\,x\, = \,a}^{\;b} {{{e^{\, - x}  - 1} \over {x^{\,2} }}dx}  =   \cr 
  &  = \int_{\,y\, = \,1/b}^{\;1/a} {\ln \left( {1 + 1/y} \right)dy}  + \int_{\,x\, = \,a}^{\;b} {{{e^{\, - x}  - 1} \over {x^{\,2} }}dx}  =   \cr 
  &  = \int_{\,y\, = \,1/b}^{\;1/a} {\left( {\ln \left( {1 + y} \right) - \ln y} \right)dy}  + \left. {\left( {E_1 (x) - {{e^{\, - x} } \over x}} \right)\,} 
\right|_{\,x\, = \,a}^{\;b}  =   \cr 
  & \left. { = \left( {\left( {1 + y} \right)\ln \left( {1 + y} \right) - y\ln y} \right)\,} \right|_{\,y\, = \,1/b}^{\;1/a}
  + \left. {\left( {E_1 (x) - {{e^{\, - x} } \over x}} \right)\,} \right|_{\,x\, = \,a}^{\;b}  =   \cr 
  & \quad  \cdots  \cr} 
$$
and in fact the Exponential integral function
is tied to $\gamma$.
