1.2. Stirling’s formula 37
so we heuristically have
exp(n log(1 +
s
n
) − s) ≈
exp(−s2/2n).
To achieve this approximation rigorously, we first scale s by
√
n to remove
the n in the denominator. Making the substitution s =
√
nx, we obtain
n! =
√
nnne−n
∞
−
√
n
exp(n log(1 +
x
√
n
) −
√
nx) dx,
thus extracting the factor of
√
n that we know from (1.47) has to be there.
Now, Taylor expansion tells us that for fixed x, we have the pointwise
convergence
(1.49) exp(n log(1 +
x
√
n
) −
√
nx) →
exp(−x2/2)
as n → ∞. To be more precise, as the function n log(1 +
x
√
n
) equals 0 with
derivative
√
n at the origin, and has second derivative
−1
(1+x/
√
n)2
, we see from
two applications of the fundamental theorem of calculus that
n log(1 +
x
√
n
) −
√
nx = −
x
0
(x − y)dy
(1 + y/
√
n)2
.
This gives a uniform lower bound
n log(1 +
x
√
n
) −
√
nx ≤
−cx2
for some c 0 when |x| ≤
√
n, and
n log(1 +
x
√
n
) −
√
nx ≤ −cx
√
n
for |x|
√
n. This is enough to keep the integrands exp(n log(1+
x
√
n
)−
√
nx)
dominated by an absolutely integrable function. By (1.49) and the Lebesgue
dominated convergence theorem, we thus have
∞
−
√
n
exp(n log(1 +
x
√
n
) −
√
nx) dx →
∞
−∞
exp(−x2/2)
dx.
A classical computation (based, for instance, on computing
∞
−∞
∞
−∞
exp(−
(x2
+
y2)/2)
dxdy in both Cartesian and polar coordinates) shows that
∞
−∞
exp(−x2/2)
dx =
√
2π
and so we conclude Stirling’s formula
(1.50) n! = (1 + o(1))
√
2πnnne−n.