These are the human proofs of Stirling's approximation, at full length.
The sharp form of Stirling's formula, with the constant and the error bounds full
This proof shows: stirling-formula.
Statement. There is a real sequence (rn)n≥1 with 0<rn<12n1 for each n≥1, such that
n!=2πn(en)nern.
In particular n!∼2πn(n/e)n. The sharper lower bound rn>12n+11 is Robbins' theorem and is not proved here.
Step 1: a convergent sequence. For n≥1 let
an=lnn!−(n+21)lnn+n,so thatn!=eann(n/e)n.
Then
an−an+1=(n+21)lnnn+1−1.
To see this, expand an+1 and use ln(n+1)!=lnn!+ln(n+1): the terms lnn! cancel, and what remains is −ln(n+1)+(n+23)ln(n+1)−(n+21)lnn+n−(n+1), which is the right side.
Step 2: a series for the difference. Put t=2n+11, so 0<t<1. Then 1−t1+t=2n2n+2=nn+1 and n+21=2t1. For 0≤t<1 we have ln1−t1+t=2∑j≥02j+1t2j+1. So
an−an+1=2t1⋅2j≥0∑2j+1t2j+1−1=j≥1∑2j+1t2j.
Step 3: two-sided bound on the difference. Every term of the series is positive, so an−an+1>0. Also 2j+11≤31 for j≥1, with strict inequality for j≥2, so
an−an+1<31j≥1∑t2j=3(1−t2)t2.
Since t−2−1=(2n+1)2−1=4n(n+1), we get 1−t2t2=4n(n+1)1. Hence
0<an−an+1<12n(n+1)1=12n1−12(n+1)1.
Step 4: the limit and the bounds on rn. Step 3 says two things. First, (an) is strictly decreasing. Second, an−12n1<an+1−12(n+1)1, so bn=an−12n1 is strictly increasing. Also bn<an≤a1 for each n, so (bn) is increasing and bounded above. It converges to a limit L. Since an=bn+12n1 and 12n1→0, the sequence (an) also converges to L. A strictly increasing sequence is smaller than its limit, and a strictly decreasing sequence is larger than its limit. So for each n≥1,
L<anandan−12n1<L.
Let rn=an−L. Then 0<rn<12n1, and n!=eLernn(n/e)n. Put K=eL. It remains to show K=2π.
Step 5: Wallis integrals. For integers m≥0 let Im=∫0π/2sinmxdx. Then I0=π/2 and I1=1. For m≥2 write sinmx=sinm−1x⋅sinx and integrate by parts: Im=(m−1)∫0π/2sinm−2xcos2xdx=(m−1)(Im−2−Im), because the boundary term −sinm−1xcosx is 0 at both ends. So Im=mm−1Im−2. Since 0≤sinx≤1 on [0,π/2], the sequence (Im) is non-increasing. By induction on m, ImIm+1=2(m+1)π: for m=0 the product is π/2, and if it holds for m, then Im+1Im+2=m+2m+1Im+1Im=2(m+2)π.
For n≥1 the monotonicity gives I2n+1≤I2n≤I2n−1. Multiply by I2n>0:
2(2n+1)π≤I2n2≤4nπ.
Multiply by 4n/π: the left side becomes 2n+12n and the right side becomes 1. Both tend to 1, so I2n2∼4nπ, that is I2n∼21π/n.
Step 6: the central binomial coefficient. The recurrence gives I2n=2π∏j=1n2j2j−1. Now ∏j=1n(2j−1)=2nn!(2n)! and ∏j=1n2j=2nn!, so I2n=2π⋅4n(n!)2(2n)!=2π(n2n)4−n. With Step 5,
(n2n)4−n=π2I2n∼π2⋅2nπ=πn1.
Step 7: the constant. By Step 4, n!∼Kn(n/e)n. So (2n)!∼K2n(2n/e)2n and (n!)2∼K2n(n/e)2n. Dividing,
(n2n)∼K2nn2nK2n(2n)2n=Kn24n.
Compare with Step 6: Kn2∼πn1, so K=2π. Then n!=2πn(n/e)nern with 0<rn<12n1, and ern→1. ■
Remark. The lower bound rn>12n+11 needs a finer estimate of the series of Step 2. Robbins gives it in the paper cited on the page. The proof above gives the upper bound 12n1 and the positivity of rn.