I need to show that $$ \sum^{\infty}_{m=1} \frac{1}{m} \frac{(-x)^m}{m!} = Ei(-x)-\ln(x)-\gamma, \qquad (1)$$ where $x>0$, (thus) $Ei(-x)=-\displaystyle \int^{\infty}_{x} \frac{e^{-t}}{t}dt$, and $\gamma$ is the Euler-Mascheroni constant. Obtaining the first two terms is not difficult (shown below), but I am not sure how to get the Euler's constant. I did not know that the constant should be $\gamma$ until I asked wolfram alpha. Here I include what I have done to get the first two terms in (1): Let \begin{equation} f(x):= \sum^{\infty}_{m=1} \frac{1}{m} \frac{(-x)^m}{m!} \qquad (2) \end{equation} Thus $$\frac{df}{dx} = - \sum^{\infty}_{m=1} \frac{(-x)^{m-1}}{m!} = \frac{1}{x} \sum^{\infty}_{m=1} \frac{(-x)^{m}}{m!} = \frac{1}{x} \left( \sum^{\infty}_{m=0} \frac{(-x)^{m}}{m!} -1 \right) = \displaystyle \frac{e^{-x}-1}{x} $$ Thus
$$f(x) = \int^{x}_{a} \frac{e^{-t}-1}{t} dt, \qquad (3)$$ for a well-chosen number $a$ which ensures that the integral in (3) represents the sum in (2). My main question is what is the criteria to correctly choose a? In fact integrating (3) yields
$$ f(x) = - \int^{a}_{x} \frac{e^{-t}}{t}\,dt - \ln(x) - \ln(a) = - \left( \int^{\infty}_{x} \frac{e^{-t}}{t}\,dt - \int^{\infty}_{a} \frac{e^{-t}}{t}\,dt \right) - \ln(x) - \ln(a) = $$ $$ Ei(-x)-\ln(x) - Ei(-a) - \ln(a) $$ So I do get the first two terms in (1) but I do not know why/how I should get the Euler's constant. I appreciate any help.