Synapse

An interconnected graph of micro-tutorials

The Gamma Function: Factorials Unchained

This is an early draft. Content may change as it gets reviewed.

The factorial $n! = 1 \times 2 \times 3 \times \cdots \times n$ is defined only for non-negative integers. The gamma function extends it to all complex numbers (except the non-positive integers):

$$\Gamma(s) = \int_0^{\infty} t^{s-1} e^{-t} \, dt$$

For positive integers: $\Gamma(n+1) = n!$

The shift by 1 is a historical accident — Euler’s original definition gives $\Gamma(n) = (n-1)!$, not $n!$. We’re stuck with it.

Why it works

Integration by parts gives the functional equation:

$$\Gamma(s+1) = s \cdot \Gamma(s)$$

This is exactly the factorial recurrence ($n! = n \times (n-1)!$), but it works for all $s$, not just integers. Starting from $\Gamma(1) = 1$:

$$\Gamma(2) = 1 \cdot \Gamma(1) = 1 = 1!$$ $$\Gamma(3) = 2 \cdot \Gamma(2) = 2 = 2!$$ $$\Gamma(4) = 3 \cdot \Gamma(3) = 6 = 3!$$

The integral smoothly interpolates between these integer values.

Euler’s discovery

Euler found the gamma function in 1729, writing to Goldbach on October 13. His original formula was:

$$\Gamma(x+1) = \lim_{N \to \infty} N^x \prod_{k=1}^{N} \frac{k}{x+k}$$

He arrived at the integral form in January 1730:

$$\int_0^1 (-\ln t)^x \, dt = \int_0^{\infty} t^x e^{-t} \, dt = \Gamma(x+1)$$

Surprising values

$$\Gamma!\left(\frac{1}{2}\right) = \sqrt{\pi}$$

Half-factorial is $\sqrt{\pi}$. This connects factorials to geometry (the area of a circle) through the Gaussian integral $\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}$.

Poles and zeros

The gamma function has simple poles at $s = 0, -1, -2, -3, \ldots$ (the non-positive integers) and no zeros anywhere.

This is significant for the zeta function. The functional equation of $\zeta$ involves $\Gamma(s/2)$, which has poles at $s = 0, -2, -4, \ldots$. These poles explain the trivial zeros of the zeta function at $s = -2, -4, -6, \ldots$:

$$\xi(s) = \pi^{-s/2} \Gamma!\left(\frac{s}{2}\right) \zeta(s)$$

The completed zeta function $\xi(s)$ satisfies $\xi(s) = \xi(1-s)$ — a beautiful symmetry around $s = 1/2$. The Riemann Hypothesis says: all the zeros of $\xi$ lie on this line of symmetry.

Connection to harmonic numbers

The digamma function $\psi(x) = \frac{d}{dx} \ln \Gamma(x)$ connects to harmonic numbers:

$$\psi(n+1) = H_n - \gamma$$

where $H_n = 1 + 1/2 + \cdots + 1/n$ is the $n$-th harmonic number and $\gamma \approx 0.5772$ is the Euler-Mascheroni constant. The gamma function, harmonic series, and Euler’s constant are all aspects of the same underlying structure.

The gamma function in the wild

Beyond number theory, the gamma function appears in: