9.5 Stirling’s Formula
Stirling’s formula is a very useful approximation for n !. I am going to give a presentation of
this which follows that in the calculus book by Courant.

Let A _{n} ≡ ∫
_{1} ^{n} ln

dx =

n ln

n − n + 1

. Now use the trapezoidal rule to approximate this
area. This rule is described in the following exercises but it is also a common topic in an
introductory calculus course. You form a uniform partition and sum the areas of the
trapezoids which result. Here is a picture in which the bottom trapezoid is one which is
included in the sum.

Thus, summing the areas of the inscribed trapezoids and denoting this approximate area
by T _{n} , it equals

n− 1
∑ ln-(k-+-1)+-ln-(k) 1 1
Tn = 2 = 2 (ln(n!)+ ln ((n − 1)!)) = ln(n!) − 2 lnn
k=1

Here this comes from the observation that ∑
_{k=1} ^{n−1} ln

= ln

from the laws of
logarithms. Of course, it follows from the picture that the approximation is smaller than

A _{n} .
Let

a _{n} =

A _{n} − T _{n} . Now consider the above picture. Approximate the area between the curve
ln

and the inscribed trapezoid with the difference in area between the two trapezoids in
the above picture. Thus

n∑− 1( ( ) )
0 ≤ an ≤ ln k + 1 − ln(k+-1)+-ln(k)
k=1 2 2

Consider the term of the series. It equals

( ( ) ) ( ( ))
1 1 1 1
2 ln k+ 2 − ln(k) − 2 ln(k +1) − ln k+ 2
1 ( ( 1 ) ) 1( ( k 1 ))
= 2 lnk 1+ 2k- − ln(k) − 2 ln (k + 1)− ln (k + 1) k-+-1 + 2(k+-1)-
( ) ( ) ( ) ( )
= 1 ln 1 + 1-- − 1ln -----1----- = 1 ln 1+ 1-- − 1ln k+-1-
2 2k 2 kk+1 + 2(k1+1) 2 2k 2 k+ 12
( ) ( ) ( ) ( )
= 1 ln 1 + 1-- − 1ln 1+ --(-1--) ≤ 1 ln 1 + 1-- − 1ln 1+ ---1----
2 2k 2 2 k + 12 2 2k 2 2 (k + 1)
Thus

( ) ( ) ( )
0 ≤ a ≤ 1ln 1+ 1 − 1 ln 1+ -1- ≤ 1ln 3 .
n 2 2 2 2n 2 2

Since a _{n} is increasing, this implies that lim_{n→∞} a _{n} = β exists. Now this implies that e ^{an} also
converges to some number α. Hence

√--
eAn- -enln-n−-n+1 nne-−n-ne
nl→im∞ eTn = lni→m∞ eln(n!)− 12 lnn = nli→m∞ n! = α

Letting c = eα ^{−1} , it follows from the above that

nne−n√nc-
nli→m∞ ---n!----= 1.

This has proved the following lemma.

Lemma 9.5.1 There exists a positive number c such that

----n!-----
nli→m∞ nn+(1∕2)e− nc = 1.

There are various ways to show that this constant c equals

. Using integration by
parts, it follows that whenever

n is a positive integer larger than 1,

∫ π∕2 ∫ π∕2
sinn(x)dx = n−-1- sinn−2(x)dx
0 n 0

Lemma 9.5.2 For m ≥ 1,

∫ π∕2
sin2m (x)dx = --(2m-−-1)⋅⋅⋅1--π-
0 2m (2m − 2)⋅⋅⋅22
∫ π∕2 2m+1 (2m) (2m − 2)⋅⋅⋅2
0 sin (x)dx = (2m-+-1)(2m-−-1)⋅⋅⋅3
Proof: Consider the first formula in the case where m = 1. From beginning
calculus,

∫ π∕2
sin2 (x )dx = π-= 1π-
0 4 22

so the formula holds in this case. Suppose it holds for m. Then from the above reduction
identity and induction,

∫ ∫
π∕2sin2m+2 (x)dx = -2m--+1-- π∕2 sin2m (x)dx
0 2(m + 1) 0
2m +1 (2m − 1)⋅⋅⋅1 π
= 2(m-+-1)2m-(2m--− 2)⋅⋅⋅22-.
The second claim is proved similarly.

■
Now from the above identities,

∫π∕2 2m 2 2 2
∫0---sin---(x)dx--= π-(2m + 1)-(2m2−-1)-⋅⋅⋅32⋅1---
0π∕2sin2m+1(x)dx 2 (2m) (2m − 2) ⋅⋅⋅22

which implies

π 1 (2m)2(2m − 2)2⋅⋅⋅22 ∫ π∕2 sin2m (x)dx
--= --------------2----2--2--∫0π∕2--2m+1------
2 2m +1 (2m − 1)⋅⋅⋅3 ⋅1 0 sin (x)dx

From the reduction identity,

∫ π∕2sin2m(x)dx ∫π∕2sin2m (x )dx 2m + 1
1 ≤ ∫-0π∕2--2m+1----- = -2m--0∫π∕2---2m-−1----- ≤ --2m--
0 sin (x)dx 2m+1 0 sin (x)dx

It follows

--2m-- --(2m-−-2)2⋅⋅⋅22-- π- --1---(2m-)2-(2m-−-2)2⋅⋅⋅222m-+-1
2m + 12m (2m − 1)2 ⋅⋅⋅32 ⋅12 ≤ 2 ≤ 2m + 1 (2m − 1)2⋅⋅⋅32 ⋅12 2m
2 2
= 2m--(2m-−-2)-⋅⋅⋅2---
(2m − 1)2⋅⋅⋅32 ⋅12
It follows that

2m π∕2
2m-+-1 ≤ ----(2m−2)2⋅⋅⋅22-≤ 1
2m (2m−1)2⋅⋅⋅32⋅12

and so

2 2
lim 2m--(2m-−-22)-⋅⋅⋅2---= π-
m→ ∞ (2m − 1) ⋅⋅⋅32 ⋅12 2

This is sometimes called Wallis’s formula. This implies

2m−2 2
lim 2m-2-----((m-−-1)!)--= π-
m→ ∞ (2m − 1)2⋅⋅⋅32 ⋅12 2

Now multiply on the bottom and top by

^{2} ^{2} 2

^{2} = 2

^{2m} ^{2} to obtain

22m−2-((m-−-1)!)222m-(m!-)2- 2 222m−2((m-−-1)!)222m(m!)2-
lmim→∞ 2m ((2m)!)2 = mli→m∞2 m 2m ((2m )!)2
2m 2 2m 2
lim 2--(m!)-2---(m!-)- = π-
m→ ∞ 2m ((2m )!)2 2
It follows that

∘ --
-22m-(m!-)2--- π-
lmi→m∞ (2m )1∕2(2m )! = 2 (9.9)
(9.9)

Now with this result, it is possible to find c in Stirling’s formula. Recall

lim -----m!------= 1
m→∞ mm+ (1∕2)e−mc

It follows that

lim ------(2m-)!------= 1
m →∞ (2m )2m+ (1∕2)e− 2mc

Therefore, from 9.9 ,

( ) ( )
∘ π- 22m mm+-(1m∕!2)e−mc 2 mm+ (1∕2)e− mc 2
2- = mli→m∞ ----1∕2(------(2m)!-----)(----2m+-(1∕2)-−-2m--)-
(2m ) (2m )2m+(1∕2)e−2mc (2m ) e c
22m (mm+ (1∕2)e−mc )2
= lim ------(-----------------)-
m→ ∞ (2m )1∕2 (2m )2m+ (1∕2)e−2mc
22mm2m+1e −2mc2
= lim ------(-----------------)-
m→ ∞ (2m )1∕2 (2m )2m+ (1∕2)e−2mc
22mm2m+1c 1
= lim ----1∕2-----2m+-(1∕2) =- c
m→ ∞ (2m ) (2m ) 2
which shows that

c =

. This proves Stirling’s formula.

Theorem 9.5.3 The following formula holds.

√---
lim -m+-m(1!∕2)−m--= 2π
m→∞ m e