# Logarithmic Integral

## Definition

The logarithmic integral is the function

$$
\operatorname{li}(x) =
\int_2^x \frac{dt}{\log t}.
$$

It plays a central role in prime number theory because it gives a remarkably accurate approximation to the prime counting function

$$
\pi(x).
$$

The Prime Number Theorem may be written in the form

$$
\pi(x)\sim \operatorname{li}(x).
$$

Although the simpler approximation

$$
\frac{x}{\log x}
$$

captures the correct order of growth, the logarithmic integral incorporates important secondary corrections.

## Origin of the Function

Suppose primes near $x$ occur with density approximately

$$
\frac1{\log x}.
$$

Then the expected number of primes in a small interval $[x,x+dx]$ should be roughly

$$
\frac{dx}{\log x}.
$$

Accumulating this local density from $2$ to $x$ gives

$$
\int_2^x \frac{dt}{\log t}.
$$

Thus the logarithmic integral naturally arises from the heuristic density law for primes.

## Basic Properties

Since $\log t>0$ for $t>1$, the integrand is positive on $(1,\infty)$. Therefore $\operatorname{li}(x)$ is increasing.

Differentiation gives

$$
\frac{d}{dx}\operatorname{li}(x) =
\frac1{\log x}.
$$

Hence the local rate of growth of $\operatorname{li}(x)$ matches the predicted local density of primes.

The function grows more slowly than $x$, but faster than any fixed power of $\log x$.

## Asymptotic Expansion

Repeated integration by parts produces the asymptotic expansion

$$
\operatorname{li}(x) =
\frac{x}{\log x}
+
\frac{x}{(\log x)^2}
+
\frac{2x}{(\log x)^3}
+
\frac{6x}{(\log x)^4}
+\cdots.
$$

More generally,

$$
\operatorname{li}(x)
\sim
\sum_{k=1}^{\infty}
\frac{(k-1)!x}{(\log x)^k}.
$$

This expansion is asymptotic rather than convergent. Truncating after finitely many terms gives increasingly accurate approximations for large $x$.

The first term alone yields

$$
\operatorname{li}(x)\sim \frac{x}{\log x}.
$$

## Comparison with $\pi(x)$

The logarithmic integral approximates $\pi(x)$ much more accurately than $x/\log x$.

For example:

| $x$ | $\pi(x)$ | $x/\log x$ | $\operatorname{li}(x)$ |
|---|---|---|---|
| $10^2$ | $25$ | $21.7$ | $30.1$ |
| $10^3$ | $168$ | $144.8$ | $177.6$ |
| $10^4$ | $1229$ | $1085.7$ | $1246.1$ |
| $10^6$ | $78498$ | $72382$ | $78627$ |

The logarithmic integral consistently tracks the true number of primes with striking accuracy.

## Singular Behavior Near $1$

The integral

$$
\int \frac{dt}{\log t}
$$

has a singularity at

$$
t=1,
$$

because

$$
\log 1=0.
$$

For this reason, the logarithmic integral is sometimes defined using the Cauchy principal value:

$$
\operatorname{Li}(x) =
\lim_{\varepsilon\to0^+}
\left(
\int_0^{1-\varepsilon}\frac{dt}{\log t}
+
\int_{1+\varepsilon}^x\frac{dt}{\log t}
\right).
$$

In elementary prime number theory, however, one usually works with

$$
\operatorname{li}(x)=\int_2^x \frac{dt}{\log t},
$$

which avoids the singularity.

## Relation to the Prime Number Theorem

The Prime Number Theorem states that

$$
\pi(x)\sim \operatorname{li}(x).
$$

Equivalently,

$$
\pi(x)-\operatorname{li}(x)=o(\operatorname{li}(x)).
$$

This means that the relative error tends to zero as $x\to\infty$.

The proof depends on analytic properties of the zeta function, especially the absence of zeros on the line

$$
\operatorname{Re}(s)=1.
$$

## Sign Changes

Numerical evidence suggests that

$$
\operatorname{li}(x)>\pi(x)
$$

for many values of $x$. In fact, this inequality holds for all commonly encountered numbers.

However, entity["people","John Edensor Littlewood","British mathematician"] proved in 1914 that the difference

$$
\pi(x)-\operatorname{li}(x)
$$

changes sign infinitely many times.

Thus there exist arbitrarily large values of $x$ for which

$$
\pi(x)>\operatorname{li}(x).
$$

The first such sign change occurs at an extraordinarily large number.

## Importance in Analytic Number Theory

The logarithmic integral serves as the main smooth approximation to prime distribution. Many estimates for primes are expressed in the form

$$
\pi(x)=\operatorname{li}(x)+\text{error term}.
$$

The quality of the approximation depends on understanding the zeros of the Riemann zeta function.

Thus the logarithmic integral stands at the intersection of asymptotic analysis, complex analysis, and prime number theory.

