# Deriving Stirling's approximation formula via the definition of the Gamma function

In my asymptotic analysis and combinatorics class I was asked this question:

We first remember the definition f the Gamma function $$\Gamma(n+1) = n! = \int_{0}^{\infty} t^{n} e^{-t} dt$$ and using this definition we are to prove Stirling's approximation formula for very large n

$$n! \sim (\frac{n}{e})^n \sqrt{2 \pi n}$$

I realize the idea is to show the limit at $$n \to \infty$$ of the quotient is 1 but since n is discrete then l'Hopital's rule is gone out the window and I do not see how to use the Gamma function definition to derive this even after giving it some thought so I am asking here in the hope of finding help. Thanks to all helpers.

Note that the Gamma Function has the integral representation

$$\Gamma(z+1)=\int_0^\infty t^ze^{-t}\,dt \tag 1$$

for $\text{Re}(z)>0$.

Enforcing the substitution $t=zs$ yields

\begin{align} \Gamma(z+1)&=z^{z+1}\int_0^\infty t^ze^{-zt}\,dt \\\\ &=z^{z+1}\int_0^\infty e^{z(\log(t)-t)}\,dt \tag 2 \end{align}

Using Laplace's Method in $(2)$ with $M=z$ and $f(t)=\log(t)-t$, we obtain

\begin{align} \Gamma(z+1)&\sim \sqrt{\frac{2\pi}{z}}e^{-z}z^{z+1}\\\\ &=\sqrt{2\pi z}\left(\frac{z}{e}\right)^z \tag 3 \end{align}

Finally, setting $z=n$ in $(3)$ yields

$$\bbox[5px,border:2px solid #C0A000]{\Gamma(n+1)=n!\sim \sqrt{2\pi n}\left(\frac ne\right)^n}$$

as was to be shown!