Functions like $\frac1{\log x}$ have no elementary integrals in terms of standard functions; they are instead represented using special function notations, such as $\mathrm{li}(x)$.

That's all and well, but how does one obtain an expression for the integral of these nonelementary integrals?

I would expect that there would be "no result found in terms of standard mathematical functions", but WolframAlpha actually gives an expression for the logarithmic integral:

$$\int \mathrm{li}(x)dx = x \, \mathrm{li}(x) - \mathrm{Ei}(2 \log x) + C.$$

(Or $x \, \mathrm{li}(x) - \mathrm{li}(x^2) + C$, for an appropriate choice of domain.)

How does WolframAlpha obtain such a result? Is there a special technique that I am unaware of?

  • 2
    $\begingroup$ That particular example is just an application of integration by parts and some manipulation. $\endgroup$ Aug 3, 2018 at 21:59
  • 1
    $\begingroup$ Similarly it may be deduced by applying Cauchy's repeated integral formula. $\endgroup$ Aug 3, 2018 at 22:00
  • $\begingroup$ So then it was just a lucky hit, rearranging the integral of $\mathrm{li}$ into a form that just happens to contain $\frac{1}{\log x}$ itself. What should I do with this question, then? $\endgroup$
    – Bladewood
    Aug 3, 2018 at 23:14
  • $\begingroup$ You could self-answer your question :-) $\endgroup$ Aug 3, 2018 at 23:20

2 Answers 2


In general, there is still often no elementary solution to these kinds of integrals.

In this case, however, there is fortunately a relatively simple way to evaluate the integral of $\mathrm{li}(x)$, involving integration by parts to first break down the nonelementary integral inside and to hope for a way to rearrange it into a simpler form.

So, using integration by parts, we find $$\int \mathrm{li}(x) \, dx = x \, \mathrm{li}(x) - \int \frac{x}{\log x} \, dx.$$

We can evaluate this new integral using the substitution $u = \log x$, which leads to $x = e^u$ and $dx = e^u \, du$.

\begin{align} \int \frac{x}{\log x} \, dx & = \int \frac{e^u}u e^u \, du \\ & = \int \frac{e^{2u}}u \, du. \end{align}

This is itself a nonelementary integral, but a common special function exists that can describe it: the exponential integral, $$\mathrm{Ei}(x) \equiv - \int_{-z}^\infty \frac{e^{-t}}t \, dt.$$

In this case, though, we're only worrying about the indefinite integral, so we'll just use $$\mathrm{Ei}(x) \equiv \int \frac{e^x}x \, dx.$$

So, using this, our integral becomes with $v = 2u$ \begin{align} \int \frac{e^{2u}}u \, du & = \int \frac{e^v}{\frac{v}2} \, \frac{dv}2 \\ & = \int \frac{e^v}v \, dv \\ & = \mathrm{Ei}(v) \\ & = \mathrm{Ei}(2 \log x). \end{align}

Substituting this back into our original integral, we obtain $$\int \mathrm{li}(x) \, dx = x \, \mathrm{li}(x) - \mathrm{Ei}(2 \log x) + C.$$


Not being a pure mathematician it is not at first obvious to me that integration by parts should automatically work for a function like $\text{li}(x)=\int_0^x \frac{1}{\log t} \,dt$ for which there is no infinite series expansion.

It's seems slightly clearer to me in this case to take the proposed solution and approach this problem by differentiating $x \,\text{li}(x)$ and $\text{li}(x^2)$ instead (even though I am differentiating a definite integral which is not the normal case):

$$\frac{d \,(x \,\text{li}(x))}{d x}=\text{li}(x)+\frac{x}{\log (x)}$$

Then rearranging and integrating gives

$$\int \text{li}(x) \, dx=x \,\text{li}(x)-\int \frac{x}{\log (x)} dx$$

and then since

$$\frac{d\, (\text{li}(x^2))}{d x}=\frac{2x}{\log (x^2)}=\frac{x}{\log (x)}$$

$$\int \frac{x}{\log (x)}\, dx= \text{li}(x^2)$$


$$\int \text{li}(x) \, dx=x \,\text{li}(x)-\text{li}(x^2)$$

Then finally finding $\text{li}(x^2)$ in terms of the exponential integral as in @Bladewood's answer.

[I am not happy with this - is it more rigorous to prove that this only works when the lower limit in the $\text{li}(x)$ function integral is constant?]


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .