12 1. Preliminary Notions

which can easily be proved by observing that

(1.13)

log(n!) = log 2 + · · · + log n

2

1

log t dt +

3

2

log t dt + · · · +

n

n−1

log t dt

=

n

1

log t dt = t log t − t

t=n

t=1

= n log n − n + 1

log

n

e

n

.

We now state Stirling’s formula in its traditional form.

Theorem 1.14. (Stirling’s formula) As n → ∞,

(1.14) n! ∼

nne−n

√

2πn.

Proof. First observe that since the function log t is increasing for t 0, it

is clear that

j

j−1

log t dt log j

j+1

j

log t dt.

Adding up these inequalities, for j = 1, 2,...,n, we obtain

n

0

log t dt log n!

n+1

1

log t dt,

n log n − n log n! (n + 1) log(n + 1) − n.

Rearranging this last expression, we obtain

n log n − n log n! n log n − n + log n + O(1),

suggesting that one should consider the expression

bn := n log n − n +

1

2

log n

as an approximation of log n!. So, let us consider the difference

an := log n! − bn = log n! − n +

1

2

log n + n.

Observe that, setting α = 1/(2n + 1) and using the fact that

1

2

log

1 + α

1 − α

= α +

1

3

α3

+

1

5

α5

+ · · · ,

we get that

0 an − an+1 = n +

1

2

log

n + 1

n

− 1

=

1

α

·

1

2

· log

1 + α

1 − α

− 1