Approximation of $\mathrm{Li}(x) = \int\limits_{0}^x \frac{dt}{\ln t}$

Minor correction: the $0$ at the lower limit should be $2$ so that the integral converges.

The approximation for any truncation of the sum on the right comes from repeated integration by parts. In the integral

$$Li(x) = \int\limits_{2}^x \frac{dt}{\ln t}$$

integrate by parts with $u = \frac{1}{\ln{t}}$ and $dv = dt$ to obtain

$$Li(x) = \frac{x}{\ln(x)} + \int\limits_{2}^x \frac{dt}{({\ln t})^2} dt - \frac{2}{\ln(2)}$$

Then iterate, setting $u = \frac{1}{{(\ln{t})}^2}$ and $dv = dt$.

If you iterate indefinitely, there's a subtlety having to do with the constant terms such as $\frac{2}{\ln{2}}$ adding up. But if you stop after a finite number of steps, repeated integration by parts gives the desired approximation.


Differentiate the right hand side (it will also tell how to continue with the constants..:)

Verify and continue these: $$\begin{align} \left(\frac{x}{\ln x}\right)' &= \frac1{\ln x}-\frac1{\ln^2x} \\ \left(\frac{x}{\ln^2 x}\right)' &= \frac1{\ln^2 x}-\frac2{\ln^3x} \\ &\dots \end{align}$$