# Approximation to Stirling's Formula for Gamma Function

## Theorem

Let:

$D_\epsilon = \left\{{z \in \C : \left\vert{\operatorname{Arg} \left({z}\right)}\right\vert < \pi - \epsilon,\ \left\vert{z}\right\vert > 1}\right\}$

where:

$\left\vert{\operatorname{Arg} \left({z}\right)}\right\vert$ denotes the absolute value of the principal argument of $z$
$\left\vert{z}\right\vert$ denotes the modulus of $z$
$\epsilon \in \R_{>0}$.

Then for all $z \in D_\epsilon$, the gamma function of $z$ satisfies:

$\Gamma \left({z}\right) = \sqrt{\dfrac {2 \pi} z} \left({\dfrac z e}\right)^z\left({1 + \mathcal O \left({z^{-1} }\right)}\right)$

where $\mathcal O \left({z^{-1} }\right)$ denotes big-O of $z^{-1}$.

## Proof

 $(1):\quad$ $\displaystyle \left({y + n}\right)^y n!$ $=$ $\displaystyle \left({y + n}\right)^y \Gamma \left({n + 1}\right)$ $\quad$ Gamma Function Extends Factorial $\quad$ $\displaystyle$ $\le$ $\displaystyle \Gamma \left({y + n + 1}\right)$ $\quad$ $\quad$ $\displaystyle$ $\le$ $\displaystyle \left({n + 1}\right)^y \Gamma \left({n + 1}\right)$ $\quad$ $\quad$ $\displaystyle$ $=$ $\displaystyle \left({n + 1}\right)^y n!$ $\quad$ $\quad$

for $0 < y \le 1$ and $n \in \N$.

Let $x$ be given.

Let $n + 1$ be the largest natural number such that $n + 1 \le x$.

Let $x = y + n + 1$, and thus $0 < y \le 1$.

Then:

 $\displaystyle \frac {\Gamma \left({x}\right)}{\sqrt{\left({2 \pi}\right)} x^x x^{-1/2} e^{-x} }$ $\le$ $\displaystyle \frac {\left({n + 1}\right)^y n!}{\sqrt{\left({2 \pi}\right)} x^x x^{-1/2} e^{-x} }$ $\quad$ from $(1)$ $\quad$ $\displaystyle$ $\sim$ $\displaystyle \frac {\left({n + 1}\right)^y n! \sqrt{\left({2 \pi}\right)} n^n n^{1/2} e^{-n} }{\sqrt{\left({2 \pi}\right)} x^x x^{-1/2} e^{-x} }$ $\quad$ Stirling's Formula $\quad$ $\displaystyle$ $=$ $\displaystyle \frac {\left({n + 1}\right)^y n! n^n n^{1/2} e^{-n} }{\left({y + n + 1}\right)^{y + n} \left({y + n + 1}\right)^{1/2} e^{-y-n-1} }$ $\quad$ $\quad$ $\displaystyle$ $=$ $\displaystyle \left({\frac {n + 1} {y + n + 1} }\right)^y \left({\frac n {y + n + 1} }\right)^{1/2} \left({1 + \frac {y + 1} n }\right)^{-n} e^{y+1}$ $\quad$ $\quad$ $\displaystyle$ $\to$ $\displaystyle 1 \cdot 1 \cdot \frac 1 {e^{y + 1} } e^{y+1} \text { as } n \to \infty$ $\quad$ $\quad$ $\displaystyle$ $=$ $\displaystyle 1$ $\quad$ $\quad$

Similarly for the right hand side.

The result follows from Gamma Function Extends Factorial.

$\blacksquare$