The question that won't go away
Welcome to the reference shelf of special functions. The first book on it is the gamma function, and it answers a question that feels almost childish until you try to answer it: what is (1/2)! ? The factorial 5! = 5 times 4 times 3 times 2 times 1 is built by repeated multiplication, and repeated multiplication only makes sense a whole number of times. Yet plot the points (1, 1), (2, 2), (3, 6), (4, 24), (5, 120) and you can almost see a smooth curve wanting to pass through them. The gamma function is that curve made precise.
There is a subtlety to confess up front: infinitely many smooth curves pass through any set of points. What singles out the gamma function is not just smoothness but a structural property — it inherits the factorial's own multiply-by-the-argument rule, and (a theorem of Bohr and Mollerup) it is the only such curve that is also log-convex. So we are not choosing arbitrarily; we are choosing the curve that behaves like a factorial everywhere, not only at the integers.
Euler's integral: the official definition
Here is the definition that actually does the work, due to Euler. For any x with positive real part, Gamma(x) = integral from 0 to infinity of t^{x-1} e^{-t} dt. Notice this is an improper integral on two counts — it runs all the way to infinity, and when x is less than 1 the factor t^{x-1} blows up near t = 0. Both threats are tame: the e^{-t} crushes the tail faster than any power can grow, and near zero the mild singularity is integrable as long as the real part of x stays above 0. So the integral converges and defines a genuine, infinitely smooth function for every such x.
Let us cash out the simplest case to see the curve really threads the factorials. Take x = 1: Gamma(1) = integral from 0 to infinity of e^{-t} dt = 1. That is the seed. To climb from one integer to the next we need the recurrence — and the recurrence falls right out of integration by parts, which you met for ordinary integrals back in Volume I.
The recurrence: where the factorial lives
Apply integration by parts to Gamma(x+1) = integral from 0 to infinity of t^x e^{-t} dt, differentiating t^x and integrating e^{-t}. The boundary term t^x times (-e^{-t}) vanishes at both ends — zero at t = 0, crushed by the exponential at infinity — and what survives is x times the integral of t^{x-1} e^{-t}, which is exactly Gamma(x). The result is the heartbeat of the whole subject: Gamma(x+1) = x Gamma(x).
Gamma(x+1) = integral_0^inf t^x e^{-t} dt
u = t^x dv = e^{-t} dt
du = x t^{x-1} v = -e^{-t}
= [ -t^x e^{-t} ]_0^inf + x integral_0^inf t^{x-1} e^{-t} dt
= 0 + x * Gamma(x)
=> Gamma(x+1) = x Gamma(x) (the factorial step)
Seed: Gamma(1) = 1 => Gamma(2)=1, Gamma(3)=2, Gamma(4)=6, ...This recurrence is more than a computational convenience — it is the tool that extends gamma beyond where the integral converges. Read it backwards as Gamma(x) = Gamma(x+1) / x. Suppose you want Gamma(-0.5), where the integral diverges. The recurrence says Gamma(-0.5) = Gamma(0.5) / (-0.5), and Gamma(0.5) is a value the integral can compute. Step by step this analytic continuation pushes gamma into the whole complex plane, except at x = 0, -1, -2, ... where dividing by zero leaves a simple pole. The factorial, once a sequence of isolated dots, becomes a function defined almost everywhere.
Gamma at one-half: a hidden Gaussian
The most beautiful single value is Gamma(1/2) = square root of pi. Where does a pi come from in a problem with no circles in sight? Set x = 1/2 in Euler's integral: Gamma(1/2) = integral from 0 to infinity of t^{-1/2} e^{-t} dt. Substitute t = u^2, so dt = 2u du and t^{-1/2} = 1/u; the 1/u and the 2u du combine to 2 du, and the integral becomes 2 times integral from 0 to infinity of e^{-u^2} du. That is the famous Gaussian integral in disguise.
And integral from 0 to infinity of e^{-u^2} du = sqrt(pi)/2 — a result usually proved by the polar-coordinate trick of squaring the integral. Multiply by the 2 out front and Gamma(1/2) = square root of pi lands in your lap. This is worth pausing on: the bell curve e^{-u^2} cannot be integrated in elementary closed form — it is a textbook non-elementary integral — yet over the whole half-line it sums to a clean square root of pi. 'Non-elementary' means 'no formula in powers, exps, logs and trig', NOT 'incomputable'. With one-half pinned down, the recurrence reaches every half-integer: Gamma(3/2) = (1/2) Gamma(1/2) = sqrt(pi)/2, Gamma(5/2) = (3/2)(1/2) sqrt(pi), and so on.
Stirling: how fast factorials really grow
Factorials explode: 10! is already over three million, and 70! overflows many calculators. For large arguments we rarely want the exact value — we want to know its size and how to compare it. That is what Stirling's approximation delivers: n! is approximately square root of (2 pi n) times (n/e)^n, or in log form ln(n!) is approximately n ln n - n. The intuition is that ln(n!) = sum of ln k from 1 to n behaves like integral from 1 to n of ln x dx = n ln n - n + 1, and Stirling makes the leftover correction precise.
Because gamma is the smooth factorial, Stirling is really a statement about Gamma(x) for large x, and it extends to non-integers. The full version is an asymptotic series — and here lies a beautiful, honest subtlety. That series actually diverges if you sum all its terms, yet truncated after a few terms it is staggeringly accurate. The reason: the error after stopping is roughly the size of the first omitted term, which at first shrinks fast before eventually growing. The art is to stop near the smallest term. So a series can diverge and still be one of the most useful tools you own.
- Want a large factorial fast: write n! = Gamma(n+1) and feed n into Stirling.
- Leading estimate: n! is about sqrt(2 pi n) times (n/e)^n — already good to about 1% by n = 10.
- Need more digits: add the next term, multiplying by (1 + 1/(12 n)), but do not keep adding forever — the series will turn on you.
- Comparing growth rates instead of exact values: use the log form ln(n!) is about n ln n - n, the workhorse of combinatorics and statistical physics.
Why this is the first book on the shelf
Gamma is the most pervasive special function precisely because so many others are built from it. The Beta function B(p, q) equals Gamma(p) Gamma(q) / Gamma(p+q), turning awkward integrals over a finite interval into a ratio of gammas. The probability distributions that wear gamma's name use it as their normalizing constant. And as you go further along this shelf — to Bessel and hypergeometric functions — their series coefficients are laced with gamma values. Learn this one function well and the rest of the special-function world becomes far less foreign.
Step back and notice the shape of the move we made. We took an operation defined only on a discrete set (multiply 1 times 2 times ... times n) and found a continuous, complex-analytic function that agrees with it and obeys the same rule everywhere. That is the recurring habit of advanced calculus: extend a familiar object by demanding it keep its defining property, then discover the extension was richer than the original. The factorial knew only whole numbers; gamma knows them all.