I am working on a heterogeneous network model and have the following expression: $$1 - \frac{z}{\lambda m} - e^{-z} - z\ln ze^{-z} - z\int_z^\infty \ln(x)e^{-x}dx.$$ where $z, \lambda, m, x$ are real numbers with $z=\lambda m \phi$. For brevity, I could not include the derivation of this expression as it is very long and it takes an entire journal article to derive. The derivation itself is not important anymore at this point.
In that article I linked, the authors take the limit as $z \to 0$ in the last integral to obtain, $$ \int_0^\infty \ln(x)e^{-x}dx = -\gamma_E $$ where $\gamma_E$ is the Euler-Mascheroni constant. What I do not understand is that they also say that by Taylor expansion, the expression approximates to
$$z\bigg[1-\gamma_E - \frac{1}{\lambda m} - \ln z\bigg].$$
I am confused as to whether they took the limit $z \to 0$ for all instances of $z$ in the expression or only in the integral. I have also tried the Taylor expansions of $e^{-z}$ but I can't progress from there. I would like to know exactly how they derived the previous expression from the first one. Any help or direction will be much appreciated. Thanks so much!
Let's define $f(z) := z\int_z^\infty e^{-x}\ln x \,\mathrm{d}x$. One has then $f'(z) = \int_z^\infty e^{-x}\ln x \,\mathrm{d}x + z\,e^{-z}\ln z$. In consequence, its first-order Taylor expansion is given by $$ f(z) = f(0) + f'(0)z + \mathcal{O}(z^2) = \gamma z + \mathcal{O}(z^2) $$ Thus we understand that the authors kept all the sub-quadratic terms; indeed, we get : $$ \begin{array}{rcl} \phi(z) &=& \displaystyle 1 - \frac{z}{\lambda m} - e^{-z} + z\,e^{-z}\ln z - f(z) \\ &=& \displaystyle 1 - \frac{z}{\lambda m} - (1 - z + \mathcal{O}(z^2)) - z\,(1 + \mathcal{O}(z))\ln z - (\gamma z + \mathcal{O}(z^2)) \\ &=& \displaystyle \left(1 - \gamma - \frac{1}{\lambda m} - \ln z\right)z + \mathcal{O}(z^2) \end{array} $$