210 CHAPTER 9. INTEGRATION

Lemma 9.7.2 Let F be increasing. Then X[a,b] ∈ R([a,b] ,F) and the following formulais valid.

∫ ba X[a,b]dF = F (b+)−F (a−) .

9.8 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 here islike the one in the Calculus book of Courant found in the references. Later I will give adifferent one found in [24]. See also [9].

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

Lemma 9.8.1 For n a positive integer,

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

∫ n+1

nln(t)dt ≤ ln

(n+

12

)(9.9)

Proof: Consider the following picture.

ln(n)

n n+1

x

tn+ 1

2

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)).Now observe the following:

exp

(n−1

∑k=1

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

)=

n−1

∏k=1

(k (k+1))1/2

= (1 ·2)1/2 (2 ·3)1/2 · · ·((n−1) ·n)1/2 = (n−1)!√

n = n!n−1/2

Letting Tn ≡ ∑n−1k=1

12 (ln(k)+ ln(k+1)) ,exp(Tn) = n!n−1/2. Then

∫ n

1ln(t)dt−Tn ≤

n−1

∑k=1

ln(

k+12

)−

n−1

∑k=1

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

210 CHAPTER 9. INTEGRATIONLemma 9.7.2 Let F be increasing. Then Kia) €R ([a,b] ,F) and the following formulais valid. fe RigpaF =F (b+) —F(a-).9.8 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 here islike the one in the Calculus book of Courant found in the references. Later I will give adifferent one found in [24]. See also [9].To begin with is a simple lemma which really depends on the shape of the graph oft — Int.Lemma 9.8.1 Forna positive integer,1 ntl 13 (In(n+ 1) +In(n)) < | In(t) dt <In (+5) (9.9)nProof: Consider the following picture.xIn(n); tn n +4 T n+1There are two trapezoids, the area of the larger one is larger than [7 ml 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 isymin(n+3) = (*- (e+)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 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)).Now observe the following:exp (x ; ni) nth) ~Tk+ 1))!?k=l k=1= (1-2)'7 (2-3)... (m1) -n)!? = (a1)! Vn = alLetting T, = D7] 5 (In (k) +In(k+1)),exp(T) =n!n7!/?. Then[ne nat <Tn(er4 )-n—|d 5 (In (kK) +In(k+1))=I