Chapter 10

Improper Integrals, Stirling’s Formula10.1 Stirling’s Formula

In this section is an elementary approach to Stirlings formula. This formula is an asymptoticapproximation for n!. It is quite old dating to about 1730. The approach followed hereis like the one in the Calculus book of Courant found in the references. For differenttreatments, see [26], [8].

To begin with is a simple lemma which really depends on the shape of the graph oft → ln t.

Lemma 10.1.1 For n a positive integer,

12(ln(n+1)+ ln(n))≤

∫ n+1

nln(t)dt ≤ ln

(n+

12

)(10.1)

Proof: Consider the following picture.

ln(n)

ln(n+1)

n n+1

x

t

n+ 12

There are two trapezoids, the area of the larger one is larger than∫ n+1

n ln(t)dt and thearea of the smaller being smaller than this integral. The equation of the line which formsthe top of the large trapezoid is

y− ln(

n+12

)=

1n+ 1

2

(x−(

n+12

))Thus the area of the large trapezoid is obtained by averaging the two vertical sides andmultiplying by the length of the base which is 1. This is easily found to be ln

(n+ 1

2

). Then

the area of the smaller trapezoid is obtained also as the average of the two vertical sidestimes the length of the base which is 1

2 (ln(n+1)+ ln(n)).Thus a lower approximation for

∫ n1 ln(t)dt, denoted as Tn is

Tn ≡n−1

∑k=1

12(ln(k)+ ln(k+1))

Then, from the above lemma,∫ n

1ln(t)dt −Tn =

n−1

∑k=1

∫ k+1

kln(t)dt −

n−1

∑k=1

12(ln(k)+ ln(k+1))

≤n−1

∑k=1

ln(

k+12

)−

n−1

∑k=1

12(ln(k)+ ln(k+1))

227

Chapter 10Improper Integrals, Stirling’s Formula10.1 Stirling’s FormulaIn this section is an elementary approach to Stirlings formula. This formula is an asymptoticapproximation for n!. It is quite old dating to about 1730. The approach followed hereis like the one in the Calculus book of Courant found in the references. For differenttreatments, see [26], [8].To begin with is a simple lemma which really depends on the shape of the graph oft — Int.Lemma 10.1.1 For n a positive integer,1 n+l 15 (In(n+1) +In(n)) < f In (t) dt <In (+5) (10.1)nProof: Consider the following picture.In(n+1)xIn(n)tn n+ 5 n+1There are two trapezoids, the area of the larger one is larger than pet In(t) dt and thearea of the smaller being smaller than this integral. The equation of the line which formsthe top of the large trapezoid isv-n(nt) = (x (n+)Thus the area of the large trapezoid is obtained by averaging the two vertical sides andmultiplying by the length of the base which is |. This is easily found to be In (n + 5). Thenthe area of the smaller trapezoid is obtained also as the average of the two vertical sidestimes the length of the base which is 5 (In(n+1)+In(n)).Thus a lower approximation for 7’ In (+) dt, denoted as T;, isTn =F F an(e) +in(e-+1)k=lThen, from the above lemma,n n—1 pk+1 n-ly][ n@a-t, = y | In(t)dt— JUS (In(k) +In(k-+1))k=17* k=ln-1 1 n—l 1In («+ 5) > 3 (In (k) +In(k+ 1))IA227