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
From Gamma Function is Unique Extension of Factorial:

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:

Similarly for the RHS.

The result follows from Gamma Function Extends Factorial.

Also see

 * Logarithmic Approximation of Error Term of Stirling's Formula for Gamma Function

In logarithmic form the error term is given in the following:


 * $\displaystyle \ln \Gamma \left({z}\right) = \left({z - \dfrac 1 2}\right) \ln z - z + \dfrac {\ln 2 \pi} 2 + \sum_{n \mathop = 1}^{d-1} \frac{B_{2n}} {2n \left({2 n - 1}\right) z^{2n-1} } + \mathcal O \left({z^{1 - 2 d}}\right)$

where $B_{2k}$ are the Bernoulli numbers.