Stirling asymptotics

(Sethna, “Entropy, Order Parameters, and Complexity”, ex. 1.5)
© 2017, James P. Sethna, all rights reserved.

Stirling’s formula is the first part of an asymptotic series. Asymptotic series are not the same as power series, but are often even more useful.

We can find Stirling’s formula for the Γ function by using Series. The first order formula gives

Normal[Series[Gamma[z],{z,∞,1}]]

(Note this is slightly different from the formula for 
 n! = Γ[n+1]. We use Normal to remove the O[1/z] terms)

We can find Stirling’s formula up to nth order by using Series to higher order. For example, for n=4,

Normal[Series[Gamma[z],{z,∞,4}]]

This can be written in a form that looks like the text by dividing by the standard Stirling formula.
Compare to formula 1.3 in exercise 1.5.

Normal[Series[Gamma[z],{z,∞,...}]]/Normal[Series[Gamma[z],{z,∞,1}]] // Expand

We evaluate successive approximations for Γ[1]= 0!
You should find that they start off rather close to the right answer, but at some point go crazy. (Higher order expansions get worse! This is characteristic of asymptotic expansions.)

Γapproximants[y_] := Table[Normal[Series[...,{z,∞,...}]]/. z->y,{n,1,35}]
Γapproximants[1.]

The expansions for 1! = Γ[2] converge better. (2 is closer to ∞ than one is.) But they too eventually go crazy. Let’s do the plot to compare the two.

ListPlot[{Γapproximants[1], Γapproximants[2]}, Joined->True]