I'm following a complex analysis course and am making an exercise in which I have to derive an integral representation for the Euler–Mascheroni constant.
I have the following definition of the Euler–Mascheroni constant: $$\gamma = \lim_{n\rightarrow\infty}\left(1 + 1/2 + +\ldots+ 1/n - \log n\right)$$
I have shown (with induction): $$1 + 1/2 + \ldots+ 1/n = \int_0^1\frac{1-(1-t)^n}{t}dt$$
I now have to show: $$\gamma = \lim_\limits{n\to\infty}\left(\int_0^1 (1-(1-t/n)^n)\frac{dt}{t} - \int_1^n(1-t/n)^n\frac{dt}{t}\right)$$
By using $e^t = \lim\limits_{n\to\infty}(1+t/n)^n$ and substituting $t$ for $1/t$ in the second integral, it then follows: $$\gamma = \int_0^1\frac{1-e^{-t}-e^{-1/t}}{t}dt$$
None of my ideas have been promising for the second step. Any suggestions?
@metamorphy pointed to this answer in the comments. It is an answer of a question about the same integral representation of $\gamma$ but with different intermediate steps. I adapted it to the answer below.
We have: $$1 + 1/2 + \ldots+ 1/n = \int_0^1\frac{1-(1-t)^n}{t}dt$$ By making the change of variable $t = x/n$, we get: $$\int_0^1\frac{1-(1-t)^n}{t}dt = \int_0^n\frac{1-(1-x/n)^n}{x}dx$$ So:
\begin{align} \gamma & = \lim_{n\rightarrow\infty}\left(1 + 1/2 + +\ldots+ 1/n - \log n\right)\\ & = \lim_{n\rightarrow\infty}\left(\int_0^n\frac{1-(1-x/n)^n}{x}dx - \int_1^n\frac{1}{x}dx\right)\\ & = \lim_{n\rightarrow\infty}\left(\int_0^1\frac{1-(1-x/n)^n}{x}dx + \int_1^n\frac{1-(1-x/n)^n}{x}dx - \int_1^n\frac{1}{x}dx\right)\\ & = \lim_{n\rightarrow\infty}\left(\int_0^11-(1-x/n)^n\frac{dx}{x} - \int_1^n(1-x/n)^n\frac{dx}{x} \right)\\ \end{align}