y=lnΓ(x)y = \ln \Gamma(x)

Graph of the Log-Gamma Function y=lnΓ(x)y = \ln \Gamma(x)

y=lnΓ(x)y = \ln \Gamma(x) is the log-gamma function, the logarithm of the gamma function. The gamma function extends the factorial to the reals, but it grows so violently that it is awkward to handle numerically, so the logarithm takes the leading role both in practice and in theory. For x>0x > 0 we have Γ(x)>0\Gamma(x) > 0, so the real logarithm is defined directly.

Domain and intercepts

The graph is drawn over x>0x > 0. We have lnΓ(x)=0\ln \Gamma(x) = 0 when Γ(x)=1\Gamma(x) = 1, at the two points x=1x = 1 and x=2x = 2. As x0+x \to 0^{+} we have Γ(x)+\Gamma(x) \to +\infty and hence y+y \to +\infty, so the yy-axis is a vertical asymptote.

Monotonicity and minimum

The derivative is the digamma function ψ(x)\psi(x). It vanishes at just one point, and that is the minimum.

ItemValue
x0x_0 at the minimum1.46163\approx 1.46163
lnΓ(x0)\ln \Gamma(x_0)0.12149\approx -0.12149
Γ(x0)\Gamma(x_0)0.88560\approx 0.88560

The valley lies between the two intercepts x=1x = 1 and x=2x = 2, and the range is y0.12149y \geq -0.12149.

Logarithmic convexity

The second derivative is the trigamma function, positive throughout x>0x > 0.

ψ(x)=n=01(x+n)2\psi'(x) = \sum_{n=0}^{\infty}\frac{1}{(x+n)^2}

The function is therefore convex everywhere and has no inflection point. That the gamma function is logarithmically convex is no ornament. Adding logarithmic convexity to Γ(1)=1\Gamma(1) = 1 and Γ(x+1)=xΓ(x)\Gamma(x+1) = x\Gamma(x) pins the function down to the gamma function alone. That is the Bohr-Mollerup theorem, the ground for saying that the correct extension of the factorial is unique1.

The recurrence

Taking the logarithm of Γ(x+1)=xΓ(x)\Gamma(x+1) = x\Gamma(x) turns a multiplication into an addition.

lnΓ(x+1)=lnx+lnΓ(x)\ln \Gamma(x+1) = \ln x + \ln \Gamma(x)

It reads as saying that shifting xx by 11 lifts the graph by lnx\ln x. At the integers lnΓ(n+1)=ln(n!)\ln \Gamma(n+1) = \ln(n!), so the curve is the logarithm of the factorial joined up smoothly.

Stirling's formula

For large xx it expands as follows2.

lnΓ(x)=(x12)lnxx+12ln(2π)+112x\ln \Gamma(x) = \left(x - \frac{1}{2}\right)\ln x - x + \frac{1}{2}\ln(2\pi) + \frac{1}{12x} - \cdots

The leading part is xlnxxx\ln x - x. Trying x=101x = 101, the true value lnΓ(101)=363.739376\ln \Gamma(101) = 363.739376 is matched to six decimal places by taking the expansion only as far as the 112x\dfrac{1}{12x} term.

Why take the logarithm

xxΓ(x)\Gamma(x)lnΓ(x)\ln \Gamma(x)
1011019.33×10157\approx 9.33 \times 10^{157}363.74\approx 363.74
20020010372\approx 10^{372}, which overflows857.93\approx 857.93

Double-precision floating point tops out around 1030810^{308}, so Γ(200)=199!\Gamma(200) = 199! overflows. Its logarithm, on the other hand, causes no trouble at all. That is why numerical libraries provide a log-gamma function alongside the gamma function.

Applications

A binomial coefficient can be written as follows, so it can be computed for large nn without overflow.

ln(nk)=lnΓ(n+1)lnΓ(k+1)lnΓ(nk+1)\ln \binom{n}{k} = \ln \Gamma(n+1) - \ln \Gamma(k+1) - \ln \Gamma(n-k+1)

In statistics the function appears directly in the log-likelihoods of the gamma, beta and Dirichlet distributions.

  1. Bohr-Mollerup theorem, Wikipedia
  2. Stirling's approximation, Wikipedia