228 CHAPTER 10. IMPROPER INTEGRALS, STIRLING’S FORMULA

=n−1

∑k=1

12

(ln(

k+12

)− ln(k)

)−

n−1

∑k=1

12

(ln(k+1)− ln

(k+

12

))≤

n−1

∑k=1

12

(ln(k)− ln

(k− 1

2

))−

n−1

∑k=1

12

(ln(k+1)− ln

(k+

12

))=

n−2

∑k=0

12

(ln(k+1)− ln

(k+

12

))−

n−1

∑k=1

12

(ln(k+1)− ln

(k+

12

))

=12

(ln(1)− ln

(12

))− 1

2

(ln(n)− ln

(n− 1

2

))≤ ln(2)

2

Now this shows that {∫ n

1 ln(t)dt −Tn}∞

n=1 is an increasing sequence bounded above and soit must converge to some real number α .

exp(Tn) =n−1

∏k=1

exp(

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

Therefore, doing the integral∫ n

1 ln(t)dt and taking the exponential of the expression,

limn→∞

exp((n ln(n)−n)−Tn) = limn→∞

e(n ln(n)−n)

n−1/2n!= lim

n→∞

nn+ 12 e−n

n!= eα

This has proved the following lemma.

Lemma 10.1.2 There exists a positive number c such that

limn→∞

n!nn+(1/2)e−nc

= 1.

In many applications, the above is enough. However, the constant can be found. Thereare various ways to show that this constant c equals

√2π . The version given here also

includes a formula which is interesting for its own sake.Using integration by parts, it follows that whenever n is a positive integer larger than 1,∫

π/2

0sinn (x)dx =

n−1n

∫π/2

0sinn−2 (x)dx

Lemma 10.1.3 For m ≥ 1,∫π/2

0sin2m (x)dx =

(2m−1) · · ·12m(2m−2) · · ·2

π

2∫π/2

0sin2m+1 (x)dx =

(2m)(2m−2) · · ·2(2m+1)(2m−1) · · ·3

Proof: Consider the first formula in the case where m = 1. From beginning calculus,∫π/2

0sin2 (x)dx =

π

4=

12

π

2

228 CHAPTER 10. IMPROPER INTEGRALS, STIRLING’S FORMULABE (604) ms) BE was n-m(ood)(on) Elon)ot ss-m(4e8)) Emon om(eed)_ (ina) In (5)) -5 (in(n)—1n (»-3)) < in)Now this shows that { f;’In (t) dt — 7, }_, is an increasing sequence bounded above and soit must converge to some real number @.IiMNI|NOlA= TNI eR; rTNIE- 2i7& lLwyn—1TLeso (5 em (&)+Im(k+1)) = [] &&+0)'?k=1= (1-2)? (2-3)? (n= 1) -n)!? = (n= Dn sain |?exp (Jn)Therefore, doing the integral f;’In(r) dt and taking the exponential of the expression,; e(nin(n)—n) ; nittenn alim exp ((In (2) —n) — T,) = lim = = lim aeThis has proved the following lemma.Lemma 10.1.2 There exists a positive number c such thatlim —U = 4noes nt(/ye-neIn many applications, the above is enough. However, the constant can be found. Thereare various ways to show that this constant c equals 27. The version given here alsoincludes a formula which is interesting for its own sake.Using integration by parts, it follows that whenever n is a positive integer larger than 1,1/2 _ m/2i sin” (x) dx = nl | sin”? (x) dx0 0nLemma 10.1.3 Form > 1,a2 — Qm=1)e xi sin" (x)dx = 2m (2m —2)-- 22m/2 » Im+1 _ (2m) (2m — 2):[ sin (dx = mt 1) ma 1) 5Proof: Consider the first formula in the case where m = 1. From beginning calculus,1/2 1/ sin? (x)dx =~ = =70