Special Functions
Gamma Function
Γ(z) = ∫₀^∞ t^(z−1) e^(−t) dt — factorial, continued to every complex number
The gamma function extends factorial to all complex numbers except the non-positive integers. Γ(n) = (n−1)! for positive integers; Γ(1/2) = √π for the half-factorial. The recurrence Γ(z+1) = z·Γ(z) generalizes the factorial step everywhere.
- DefinitionΓ(z) = ∫₀^∞ t^(z−1) e^(−t) dt for Re(z) > 0
- RecurrenceΓ(z+1) = z·Γ(z)
- Integer valuesΓ(n) = (n−1)! for n ∈ ℤ₊
- Half-integerΓ(1/2) = √π
- PolesSimple poles at z = 0, −1, −2, ... with residue (−1)ⁿ/n!
- UniquenessBohr-Mollerup — only log-convex extension of factorial
Watch the 60-second explainer
A condensed visual walkthrough — narrated, captioned, under a minute.
Why we want a continuous factorial
Factorial n! = n · (n−1) · … · 2 · 1 is defined only for non-negative integers. The values jump: 0! = 1, 1! = 1, 2! = 2, 3! = 6, 4! = 24, 5! = 120. What about 2.5!? Or (−1/3)!? Or i!?
Euler asked this question in 1729. He sought a function that (i) agrees with factorial at the integers and (ii) is smoothly defined in between. The answer is the gamma function, and the integral representation Γ(z) = ∫₀^∞ t^(z−1) e^(−t) dt is the cleanest closed form.
The notational shift Γ(n) = (n−1)! (rather than n!) is Legendre's, dating to 1809. It's an irritating offset by 1 that nobody loves but everyone uses.
The integral definition
Γ(z) = ∫₀^∞ t^(z−1) · e^(−t) dt, Re(z) > 0.
This is Euler's integral of the second kind. The exponential decay e^(−t) kills any polynomial growth, so the integral converges for any z with Re(z) > 0. To extend to other complex z, we use the recurrence (next section) — or, more deeply, the Weierstrass product or Hankel contour.
The functional equation Γ(z+1) = z·Γ(z)
Integrate by parts on Γ(z+1) = ∫₀^∞ tᶻ e^(−t) dt with u = tᶻ, dv = e^(−t) dt:
Γ(z+1) = ∫₀^∞ tᶻ e^(−t) dt
= [−tᶻ e^(−t)]₀^∞ + z · ∫₀^∞ t^(z−1) e^(−t) dt
= 0 + z · Γ(z)
= z · Γ(z).
The boundary term vanishes — at t = 0 the tᶻ factor wins for Re(z) > 0; at t = ∞ the e^(−t) factor wins. The recurrence is the same step that builds factorial: n! = n · (n−1)!.
Combined with Γ(1) = ∫₀^∞ e^(−t) dt = 1, the recurrence gives Γ(2) = 1·1 = 1, Γ(3) = 2·1 = 2, Γ(4) = 3·2 = 6, …, Γ(n) = (n−1)! for every positive integer.
The half-integer values and Γ(1/2) = √π
For Γ(1/2), substitute t = u² (so dt = 2u du, t^(−1/2) = 1/u):
Γ(1/2) = ∫₀^∞ t^(−1/2) e^(−t) dt
= ∫₀^∞ (1/u) · e^(−u²) · 2u du
= 2 ∫₀^∞ e^(−u²) du
= √π.
The last step is the Gaussian integral. Applying the recurrence gives all half-integer values:
Γ(3/2) = (1/2) · Γ(1/2) = (1/2) √π
Γ(5/2) = (3/2) · Γ(3/2) = (3/4) √π
Γ(n+1/2) = ((2n)! / (4ⁿ · n!)) · √π (general formula)
The appearance of √π is why π shows up in formulas you'd expect to be √π-free — like the volume of a sphere, the normalizing constant of the normal distribution, and Stirling's approximation.
Where Γ blows up
The recurrence Γ(z) = Γ(z+1)/z reveals the poles. At z = 0: Γ(0) = Γ(1)/0 = 1/0 — diverges. At z = −1: Γ(−1) = Γ(0)/(−1) — diverges (since Γ(0) is already infinite, but as a pole). By induction, Γ has simple poles at every non-positive integer 0, −1, −2, −3, …, with residue (−1)ⁿ/n! at z = −n.
Between the poles, Γ takes positive values for z > 0 and oscillates sign in each interval (−n−1, −n) for negative z. The graph of Γ on the real line is the canonical picture — smooth positive curve through factorial points for z > 0, with sharp asymptotes at every non-positive integer.
Bohr-Mollerup — Γ is the unique log-convex extension
Many functions interpolate the factorial through (1, 0!), (2, 1!), (3, 2!), …. Why is Γ the "right" one?
The Bohr-Mollerup theorem (1922) gives the answer: Γ is the unique function f : (0, ∞) → (0, ∞) satisfying:
- f(1) = 1,
- f(z+1) = z·f(z) for all z > 0,
- log f is convex on (0, ∞).
The third condition (log-convexity) is what singles out Γ. Without it, any function that satisfies (1) and (2) on the integers but wiggles between them would qualify. Log-convexity is a smoothness condition that says "no wiggles — the function curves up gently."
Γ vs factorial vs Beta — pick your tool
| Factorial n! | Gamma Γ(z) | Beta B(x, y) | |
|---|---|---|---|
| Domain | Non-negative integers | ℂ ∖ {0, −1, −2, ...} | {(x, y) : Re x, Re y > 0} |
| Recurrence | n! = n·(n−1)! | Γ(z+1) = z·Γ(z) | B(x, y) = Γ(x)Γ(y)/Γ(x+y) |
| Where it appears | Combinatorics, basic probability | All special functions, complex analysis, QFT | Order statistics, beta distribution |
| Hard values | Trivial — multiply integers | Γ(1/2) = √π is famous | B(1/2, 1/2) = π |
| Closed form | Product of integers | Improper integral or limit | Beta integral on [0, 1] |
| Defined for negatives? | No | Yes (except non-positive integers) | Generally needs x, y > 0 |
Where Γ appears in the wild
- Probability distributions. The gamma distribution (waiting times in Poisson processes) uses Γ in its normalizing constant. Chi-squared, Student's t, beta, F, and Erlang distributions all involve Γ.
- The normal distribution. The normalizing constant 1/√(2π) comes from ∫e^(−x²/2) dx = √(2π) — and √(2π) is Γ(1/2)·√2 in disguise. The reason π appears in normality is the Gaussian's connection to Γ(1/2).
- Volume of an n-ball. The volume of the unit ball in n dimensions is πⁿ/² / Γ(n/2 + 1). For n = 1, 2, 3, 4 — 2, π, 4π/3, π²/2. The formula unifies all dimensions through Γ.
- Riemann zeta function. Riemann's functional equation has Γ(s/2) as a factor: ζ(s)·Γ(s/2)·π^(−s/2) is symmetric under s → 1 − s. Without Γ, the functional equation can't be stated.
- Quantum field theory regularization. Dimensional regularization replaces 4-dimensional integrals with d-dimensional ones; Γ provides the analytic continuation that lets you take d → 4 cleanly.
- Combinatorics. Binomial coefficients (a + b choose b) = Γ(a + b + 1)/(Γ(a + 1)·Γ(b + 1)) extend to non-integer arguments — useful in analytic combinatorics and generating-function asymptotics.
- Stirling's approximation. Γ(z) ≈ √(2π)·z^(z−1/2)·e^(−z) for large z — the smooth-curve version of Stirling's formula for factorial.
Common mistakes and misconceptions
- Confusing Γ(n) with n!. Γ(n) = (n−1)!, not n!. The offset is constant and easy to fix, but easy to forget mid-calculation.
- Trying to evaluate Γ at non-positive integers. Γ is undefined at 0, −1, −2, …. Computations involving Γ at these points must use limits or residues.
- Forgetting log-convexity as a defining property. Many alternative interpolations of factorial exist; only the log-convex one is Γ.
- Misapplying the Beta-Gamma identity. B(x, y) = Γ(x)Γ(y)/Γ(x + y) — not Γ(x + y)/(Γ(x)Γ(y)). The arrangement matters.
- Numerical instability. Direct evaluation of Γ(z) for very large z overflows; use Stirling, or lgamma (the log of |Γ|), which most numerical libraries provide.
- Sign confusion at negative values. Γ alternates sign between consecutive non-positive integers — Γ(−1/2) = −2√π is negative, Γ(−3/2) = (4/3)√π is positive. Track signs carefully.
Connections to other concepts
Beta function. Beta is Γ's two-variable cousin: B(x, y) = Γ(x)Γ(y)/Γ(x + y). It governs order statistics and integrals on the simplex.
Riemann zeta function. ζ(s) = ∑1/nˢ has a functional equation involving Γ(s/2). The connection links Γ to prime number distribution via analytic number theory.
Hypergeometric functions. ₁F₁, ₂F₁, and other hypergeometric functions have Γ in their power-series coefficients. They generalize the gamma function the same way the gamma function generalizes factorial.
Stirling's approximation. n! ≈ √(2πn)·(n/e)ⁿ extends to Γ(z) ≈ √(2π)·z^(z−1/2)·e^(−z). The smooth version of Stirling.
Volume of high-dimensional balls. Volume Vₙ = πⁿ/²/Γ(n/2+1) — the formula that says volume grows then shrinks with dimension, peaking around n = 5.
Frequently asked questions
Why is Γ(n) = (n−1)! instead of n!?
Convention — Legendre's, set in 1809 — shifted the index by one. The functional equation Γ(z+1) = z·Γ(z) with Γ(1) = 1 forces Γ(n) = (n−1)! for positive integers. Many mathematicians (including Gauss) preferred Π(n) = n!, but Legendre's convention stuck and became standard. The shift is irritating in calculations but historically entrenched. Practical advice — when in doubt, compute Γ(z+1) = z! and pretend the offset doesn't exist.
How do you prove Γ(1/2) = √π?
Substitute t = u² in Γ(1/2) = ∫₀^∞ t^(−1/2) e^(−t) dt. Then dt = 2u du and t^(−1/2) = 1/u. So Γ(1/2) = ∫₀^∞ (1/u)·e^(−u²)·2u du = 2 ∫₀^∞ e^(−u²) du = √π — the last equality using the Gaussian integral. This is the famous formula and the cornerstone of how π appears in probability (normal distribution) and in the volume formulas for spheres.
Where do the poles of Γ come from?
From the recurrence Γ(z+1) = z·Γ(z), rewritten as Γ(z) = Γ(z+1)/z. At z = 0 this gives Γ(0) = Γ(1)/0 = 1/0, which blows up. By induction, Γ has simple poles at all non-positive integers z = 0, −1, −2, −3, .... The residues are residueₙ(−n) = (−1)ⁿ/n!. The poles exist because factorial "doesn't make sense" for negative integers, and Γ inherits that obstruction.
Is the integral the only way to define Γ?
No — Γ has multiple equivalent definitions. Euler's integral Γ(z) = ∫₀^∞ t^(z−1) e^(−t) dt for Re(z) > 0. Weierstrass's product 1/Γ(z) = z·e^(γz)·∏(1 + z/n)·e^(−z/n) for all complex z, makes the poles obvious. Gauss's limit Γ(z) = lim_{n→∞} n!·nᶻ/(z(z+1)…(z+n)) gives a constructive definition. Hankel's contour integral works for all complex z. Each is useful — the integral for numerical evaluation, the product for analytic structure, the limit for proofs.
What is the Bohr-Mollerup theorem?
It says — Γ is the unique function f — (0, ∞) → (0, ∞) satisfying f(1) = 1, f(z+1) = z·f(z), and log-convexity (log f is convex). Without log-convexity there are infinitely many functions interpolating the factorial. The theorem singles out Γ as the natural one. Proven in 1922 by Harald Bohr (Niels's brother) and Johannes Mollerup. The "right" generalization of factorial is the log-convex one.
How is Γ related to the Beta function?
Beta is defined by B(x, y) = ∫₀¹ t^(x−1) (1−t)^(y−1) dt for x, y > 0. The fundamental identity is B(x, y) = Γ(x)·Γ(y)/Γ(x + y). So Beta values reduce to Gamma values. Beta governs the beta distribution in statistics and probabilities of order statistics; Gamma governs the gamma distribution and waiting times in Poisson processes. The two functions are inseparable in probability theory.
Where does the gamma function show up in real applications?
Probability and statistics — gamma, chi-squared, beta, F, Student's t distributions all depend on Γ. The normalizing constant in the normal distribution involves √(2π) via Γ(1/2). Combinatorics — generating functions for permutations and partitions. Analytic number theory — Riemann zeta function's functional equation has Γ as a factor. Quantum field theory — dimensional regularization uses Γ to make divergent integrals finite. Volume of an n-dimensional ball — Vₙ(R) = πⁿ/² Rⁿ / Γ(n/2 + 1).