# Stirling's Series Derivation

I was reading this paper and at the top of page 9 it says that as $n\to\infty$, $$\left(1+\frac{1}{n}\right)^{n+1/2}e^{-1}\left(1+\frac{a_1}{(n+1)}+\frac{a_2}{(n+1)^2}+\cdots \right)=1+\frac{a_1}{n}+\frac {a_2-a_1+1/12}{n^2}+\frac{(13/12) a_1-2a_2+a_3-1/12}{n^3}...$$ I just do not understand where the $1/12,~13/12,~\text{etc.}$ come from, so can anybody enlighten me?

And something else:

If I have shown the exact relation $n!= \sqrt{n}(n/e)^n e^{1-E(n)}$ where $$E(n)=\sum\limits_{k=1}^{n-1} \biggl[\left(\frac {2k+1}{2}\right)\ln \left(\frac{k+1}{k}\right)-1\biggl]$$ that after some working gets to $$\sum\limits_{k=1}^{n-1} \biggl[\left(\frac{1}{3(2k+1)^2}+\frac{1}{5(2k+1)^4}+ \cdots\right)\biggl]<\frac{n-1}{12n},$$ can I use this in any way to derive Stirling's series (the series, not the first term)?

I know that I can derive the series using the Euler-Maclaurin formula but I want this for an essay and I am well off the word limit to introduce a new result.

Thank you.

• A detailed derivation of Stirling's formula can be found in "Concrete Mathematic" by Graham, Knuth and Patashnik (in fact, the derivation is done bit-by-bit all over the book). Does this help? – Johannes Kloos Jan 22 '13 at 21:13
• How is the first question related to the second? – Rahul Jan 29 '13 at 5:40

Stirling formula can be derived using steepest descent.

$n! = \int_0^\infty t^n e^{-t} \, dt = \int_0^\infty e^{-t + n \ln t} \, dt$

The exponent $f(t) = -t + n \ln t$ has critical point at $t = n$ since $f'(t) = -1 + n/t$

$f(t) = -n + n \ln n - \frac{1}{2n} (t-n)^2 + O(t-n)^3$

This second order expansion means we can approximate the factorial function using a Gaussian integral:

$n! \simeq \int_0^\infty e^{-n + n \ln n - \frac{1}{2n} (t-n)^2 } \, dt = e^{-n + n \ln n} \sqrt{2\pi n}$

If you're more careful, you can get all the terms this way. Nobody really has a good explanation for it, though.

In general, if $x_0$ is a critical point of $f$ then Laplace's method gives

$\int_a^b e^{M f(x)} \, dx \approx \sqrt{\frac{ 2\pi }{ M | f''(x_0)|}}e^{M f(x_0)}$

The Euler constant $e$ has a standard representation as the limit, as $n\rightarrow \infty$, of $(1+1/n)^n$. For finite values of $n$, the product in the expression you look at has the expansion $e^{-1}(1+1/n)^n=1-\frac{1}{2n}+\frac{11}{24n^2}\ldots$. The actual factor we have is $e^{-1}(1+1/n)^n(1+1/n)^{1/2}$. Using the series for $(1+x)^{1/2}=1+(1/2)x+\ldots$, (with $x=1/n$) multiplying the series, and collecting terms, you get:$e^{-1}(1+1/n)^n=1+\frac{1}{12n^2}-\frac{1}{12 n^3}\ldots$. This is easy to check in Mathematica but even by hand is not that bad once we use the basic representation of $e$. This calculation gives the terms not involving $a_i$.

As for the $13/12$ and such terms, they come from expanding $\frac{1}{n+1}=\frac{1}{n}\frac{n}{n+1}=\frac{1}{n}\frac{1}{1+(1/n)}=\frac{1}{n}(1-\frac{1}{n}+\frac{1}{n^2}+\ldots$), again, collecting terms and such.

This is an answer to the first part of the question.