---
tag: 53750WSJ6K
kind: statement
role: theorem
name: Stirling's formula for the gamma function
msc: [33B15, 41A60]
uses: [0V3FZMVB4K, 02QGGD5G87, 0QR92XBV6H]
about: [0H5SYBSED9]
sources:
  - url: https://en.wikipedia.org/wiki/Stirling%27s_approximation
---

## Statement

Let $\Gamma$ be the [[gamma function|0V3FZMVB4K]], let $\operatorname{Log}$ be the principal [[complex logarithm|02QGGD5G87]], and for $z \in \C \setminus (-\infty, 0]$ let $z^{z - 1/2} = e^{(z - 1/2)\operatorname{Log} z}$.
Fix $\delta$ with $0 < \delta < \pi$.
Then, as $\abs{z} \to \infty$ with $\abs{\arg z} \le \pi - \delta$,
$$\Gamma(z) = \sqrt{2\pi}\; z^{z - 1/2} \, e^{-z} \left(1 + O\!\left(\frac{1}{\abs{z}}\right)\right),$$
where the constant in $O$ depends only on $\delta$.
In particular $\Gamma(z)$ is [[asymptotically equivalent|0QR92XBV6H]] to $\sqrt{2\pi}\, z^{z - 1/2} e^{-z}$ in this sector.

## Remarks

The proof starts from [[Binet's formula|AGBWPB994F]], which writes $\operatorname{Log}\Gamma(z) - (z - \tfrac12)\operatorname{Log} z + z - \tfrac12\ln(2\pi)$ as an integral that is $O(1/\abs{z})$ for $\operatorname{Re} z > 0$; rotating the line of integration extends this bound to the whole sector.
Another route is Laplace's method applied to Euler's integral $\Gamma(x + 1) = \int_0^\infty e^{x \ln t - t}\,dt$, whose integrand peaks at $t = x$.
For real $x \to \infty$ it gives $\Gamma(x + 1) \sim \sqrt{2\pi x}\,(x/e)^x$; at integers this is [[Stirling's formula|0KC0F51T6A]] for $n!$.
The sector condition is needed: on the negative real axis $\Gamma$ has poles, so no such estimate holds near it.
The full asymptotic series for $\operatorname{Log}\Gamma(z)$ is [[Stirling's series|K29QYWB6A5]].

## Explanations

### L1 human

Stirling's formula tells how big $\Gamma(z)$ is when $z$ is large.
It extends the classical estimate $n! \approx \sqrt{2\pi n}\,(n/e)^n$ from whole numbers to real and complex arguments.

### L2 human

The complex form gives the decay of $\Gamma$ on vertical lines: for fixed real $x$, $\abs{\Gamma(x + iy)} \sim \sqrt{2\pi}\,\abs{y}^{x - 1/2} e^{-\pi\abs{y}/2}$ as $\abs{y} \to \infty$.
This decay is what makes Mellin–Barnes integrals and the inverse Mellin transform converge, and it is used to estimate the Riemann zeta function through its functional equation.
Dividing two instances gives $\Gamma(x + a)/\Gamma(x) \sim x^a$ as $x \to \infty$.
