Why do so many identities for the Logarithmic Integral begin with the terms $\log \log n + \gamma +...$? Several identities for the log integral lead with the terms $\log \log n + \gamma$, where $\gamma$ is the Euler–Mascheroni constant.
So, for example, there's the well-known
$$\text{li}(n) = \log \log n + \gamma + \sum_{k=1}^\infty \dfrac{(\log n)^k}{k! k}$$
and
$$\text{li}(n) = \log \log n + \gamma + n^{\frac{1}{2}}\sum_{x=1}^\infty \frac{(-1)^{x-1}(\log n)^x}{x! 2^{x-1}}\sum_{k=0}^{\lfloor (x-1)/2 \rfloor} \frac{1}{2k+1} $$
or (I don't have good references for the rest of these but they all hold empirically), with $L_n(x)$ the Laguerre polynomials,
$$\text{li}(n) = \log \log n + \gamma + \lim_{x \rightarrow 0}\frac{L_{-x}(n)-1}{x}$$
and
$$\text{li}(n) = \log \log n + \gamma + \frac{\partial}{\partial x}L_{-x}(n) \text{ at } x=0$$
and
$$\text{li}(n) = \log \log n + \gamma + \lim_{c \rightarrow 1^+} \sum_{j=1}^{\lfloor \frac{\log n}{\log c}\rfloor}\frac{c^j - 1}{j}$$
and
$$\text{li}(n) = \log \log n + \gamma + \sum_{k=1}^\infty k^{-1}(\frac{\Gamma(k, -\log n)}{\Gamma(k)}-1) $$
where $\Gamma(k,n)$ is the upper incomplete gamma function.
In other instances, such as
$$\text{li}(n)=\int_0^n\frac{dt}{\log t}$$
and
$$\text{li}(n)=-\pi i - \Gamma(0, -\log n)$$
of course, there is no $\log \log n + \gamma$.
Is there a specific reason why so many of these identities lead with $\log \log n + \gamma$?  I find it very perplexing.
 A: 
why does $\log \log n + \gamma$ appear when looking at $\operatorname{li}(n)$?

For $x > 1$, $\operatorname{li}(x)$ is defined as a principal value integral,
$$\operatorname{li}(x) = \lim_{\varepsilon \searrow 0}\: \Biggl(\int_0^{1-\varepsilon} \frac{dt}{\log t} + \int_{1+\varepsilon}^x \frac{dt}{\log t}\Biggr)\,.$$
The first of the two integrals contributes the $\gamma$. Writing $\delta = -\log (1-\varepsilon)$, the substitution $t = e^{-u}$ yields
\begin{align}
\int_0^{1-\varepsilon} \frac{dt}{\log t}
&= -\int_{\delta}^{\infty} \frac{e^{-u}}{u}\,du \\
&= \bigl(-e^{-u}\log u\bigr)\biggr\rvert_{\delta}^{\infty}
- \int_{\delta}^{\infty} e^{-u}\log u\,du \\
&= e^{-\delta}\log \delta + \int_0^{\delta} e^{-u}\log u\,du - \int_0^{\infty} e^{-u}\log u\,du \\
&= \log \delta - (1-e^{-\delta})\log\delta + \int_0^{\delta} e^{-u}\log u\,du - \int_0^{\infty} e^{-u}\log u\,du \\
&= \log \delta - \int_0^{\delta} \frac{1-e^{-v}}{v}\,dv - \int_0^{\infty} e^{-u}\log u\,du\\
&= \log \varepsilon + \gamma + O(\varepsilon)\,,
\end{align}
using
$$\gamma = -\Gamma'(1) = -\frac{d}{d\alpha}\biggr\rvert_{\alpha = 1}\int_0^{\infty} u^{\alpha-1}e^{-u}\,du$$
and differentiating under the integral.
The $\log \log x$ term arises naturally in several ways to evaluate the second integral. If we make the substitution $t = e^u$ there, we obtain
$$\int_{1+\varepsilon}^x \frac{dt}{\log t} = \int_{\log (1+\varepsilon)}^{\log x} \frac{e^u}{u}\,du\,,$$
and since the integrand on the right behaves very much like $1/u$ near $0$ it is natural to write it as $\frac{1}{u} + \frac{e^u-1}{u}$ to get one part we can easily explicitly evaluate, and another well-behaved part. This yields
\begin{align}
\int_{1+\varepsilon}^x \frac{dt}{\log t}
&= \int_{\log (1 + \varepsilon)}^{\log x} \frac{du}{u} + \int_{\log (1+\varepsilon)}^{\log x} \frac{e^u-1}{u}\,du \\
&= \log \log x - \log \log (1+\varepsilon) \\
&\qquad + \int_0^{\log x} \frac{e^u-1}{u}\,du - \int_0^{\log (1+\varepsilon)} \frac{e^u-1}{u}\,du \\
&= \log \log x - \log \varepsilon + \int_0^{\log x} \frac{e^u-1}{u}\,du + O(\varepsilon)\,.
\end{align}
Adding both parts and taking the limit thus gives
$$\operatorname{li}(x) = \log \log x + \gamma + \int_0^{\log x} \frac{e^u-1}{u}\,du$$
for $x > 1$. Expanding the last integrand into a power series and integrating term by term yields the first formula.
