Special Functions

logarithmic integral

/ the symbol li is read 'el-eye' /

How many prime numbers are there below a million? The astonishing answer is that the count is very closely tracked by a single non-elementary integral. The logarithmic integral, li(x), is the running area under one over the natural logarithm — a function so closely tied to the distribution of primes that it is the headline term of the prime number theorem.

Its definition is li(x) = the (principal-value) integral from 0 to x of dt over ln t. A principal value is required because the integrand has a pole at t = 1, where ln t = 0; you split the integral and take the symmetric limit across that point. Because 1/ln t has no elementary antiderivative, li joins erf and Ei on the shelf of named integrals. A closely related, pole-free variant is the offset logarithmic integral Li(x) = integral from 2 to x of dt over ln t, which starts cleanly at 2 and differs from li by the constant li(2) approximately 1.045.

The logarithmic integral is the best simple estimate of the prime-counting function: the number of primes up to x is approximately li(x), and this approximation is far more accurate than the cruder x over ln x. A famous subtlety lives here: for every x that has ever been checked li(x) overestimates the prime count, yet Littlewood proved the difference changes sign infinitely often, the first crossover (Skewes' number) lying at an almost unimaginably large value. This is a clean reminder that numerical evidence, however vast, is not proof.

There are 78498 primes below 10^6, while Li(10^6) is approximately 78627 — an overcount of about 129, far tighter than the estimate 10^6 over ln(10^6) is approximately 72382.

The logarithmic integral tracks the prime count to a small relative error, vastly outperforming x over ln x.

li(x) needs a principal value at the pole t = 1, and the apparent rule 'li always overestimates the prime count' is false — it provably fails, just at incomprehensibly large x.

Also called
liLi对数积分函数li 函数