Gamma and beta functions; Stirling's formula

Database › Mathematics › Mathematical physics › Special functions

SPF-0001FormulaUndergraduate

The gamma function extends the factorial to non-integer arguments, the beta function packages many trigonometric and algebraic integrals, and Stirling's formula approximates large factorials.

$$\Gamma(z)=\int_0^\infty t^{z-1}e^{-t}dt,\ \ \Gamma(n+1)=n!,\ \ \Gamma(\tfrac12)=\sqrt\pi,\ \ \Gamma(z)\Gamma(1-z)=\frac{\pi}{\sin\pi z};\qquad B(m,n)=\frac{\Gamma(m)\Gamma(n)}{\Gamma(m+n)}=2\int_0^{\pi/2}\sin^{2m-1}\theta\cos^{2n-1}\theta\,d\theta;\qquad n!\approx\sqrt{2\pi n}\Big(\frac ne\Big)^n$$

Explanation

Integration by parts gives $\Gamma(z+1)=z\Gamma(z)$; with $\Gamma(1)=1$ this reproduces factorials, and the recursion continues $\Gamma$ to negative non-integers (poles at $0,-1,-2,\dots$). $\Gamma(\frac12)=\sqrt\pi$ is the Gaussian integral in disguise; half-integer values follow, e.g. $\Gamma(\frac52)=\frac34\sqrt\pi$.

Stirling's formula, obtained by the saddle-point method on the integral, has relative error about $1/12n$; its logarithm $\ln n!\approx n\ln n-n$ is used constantly in statistical mechanics. Many integrals of the forms $\int x^ae^{-bx^c}dx$ and $\int_0^1x^a(1-x)^bdx$ reduce to $\Gamma$ and $B$.

Example 1

Evaluate $\int_0^\infty x^4e^{-x^2}dx$ and $\int_0^{\pi/2}\sin^4\theta\cos^2\theta\,d\theta$.

Solution

With $t=x^2$: $\frac12\Gamma(\frac52)=\frac{3\sqrt\pi}{8}$. Second: $\frac12B(\frac52,\frac32)=\frac12\frac{\Gamma(\frac52)\Gamma(\frac32)}{\Gamma(4)}=\frac12\cdot\frac{(3\sqrt\pi/4)(\sqrt\pi/2)}{6}=\frac{\pi}{32}$.

Example 2

How accurate is Stirling's formula for $10!$?

Solution

$10!=3\,628\,800$; $\sqrt{20\pi}(10/e)^{10}\approx3\,598\,696$, low by 0.83 %, close to the predicted $1/(12\times10)\approx0.83$ %.

Related entries