I ran into a "well-known identity" on page 345 of Shepp and Lloyd's [On ordered cycle lengths in a random permutation](http://www.jstor.org/pss/1994483):
$$\int\_x^{\infty} \frac{\exp(-y)}y dy = \int\_0^x \frac{1-\exp(-y)}y dy - \log x - \gamma, $$
 where $\gamma$ is the Euler constant. I am clueless as to how it is derived. Any reference to the derivation of such formulae would suffice, but an explicit solution will also be appreciated.



Reference request for a "well-known identity" in a paper of Shepp and Lloyd
You can apply WZ theory to such identities. In particular, both sides satisfy
$$x\*z''(x) + (x+1)z'(x)$$
Picking $x=1$ as the initial condition (since the DE is regular there, that helps), we see that both sides evaluate to $Ei(1,1)$ and their derivatives both evaluate to $-1/e$, so they are equal.


I got that differential equation using Maple's *PDEtools[dpolyform]* function, which uses Groebner bases over differential polynomials to 'solve' this problem. All the rest is classical analysis (as in [A course of modern analysis](http://www.cambridge.org/catalogue/catalogue.asp?isbn=9780521588072) by Whittaker and Watson, 1926 - which is unfortunately not material that is taught very much anymore, I certainly had to learn a lot of that 'on my own').


[Edit: fixed an error in the evaluation of the derivative, I pasted in the wrong line]


