Steven R. Dunbar
Department of Mathematics
203 Avery Hall
Lincoln, NE 68588-0130
http://www.math.unl.edu
Voice: 402-472-3731
Fax: 402-472-8466

Topics in
Probability Theory and Stochastic Processes
Steven R. Dunbar

__________________________________________________________________________

Stirling’s Formula in Real and Complex Variables

_______________________________________________________________________

Note: To read these pages properly, you will need the latest version of the Mozilla Firefox browser, with the STIX fonts installed. In a few sections, you will also need the latest Java plug-in, and JavaScript must be enabled. If you use a browser other than Firefox, you should be able to access the pages and run the applets. However, mathematical expressions will probably not display correctly. Firefox is currently the only browser that supports all of the open standards.

_______________________________________________________________________________________________ ### Rating

Mathematicians Only: prolonged scenes of intense rigor.

_______________________________________________________________________________________________ ### Section Starter Question

Can you name a function defined as an integral? Can you name a function defined as a limit? Can you name a function defined as an infinite product? What is the Hadamard Product Theorem in complex analysis?

_______________________________________________________________________________________________ ### Key Concepts

1. The Gamma function is defined as
$\Gamma \left(z\right)={\int }_{0}^{\infty }{x}^{z-1}{e}^{-x}\phantom{\rule{0em}{0ex}}dx\phantom{\rule{0em}{0ex}}.$

2. Stirling’s Formula in real variables is
$\Gamma \left(z\right)\sim {\left(\frac{z-1}{e}\right)}^{z-1}\sqrt{2\pi \left(z-1\right)}$

as $z\to \infty$.

3. Gauss’s Formula for the Gamma function is
$\Gamma \left(z\right)=\underset{n\to \infty }{lim}\frac{{n}^{z}n!}{z\left(z+1\right)\left(z+2\right)\dots \left(z+n\right)}$

valid for complex values of $z\ne -1,-2,-3,\dots$.

4. Several important properties of the Gamma function follow immediately from Gauss’s formula.

__________________________________________________________________________ ### Vocabulary

1. The Gamma function is defined as
$\Gamma \left(z\right)={\int }_{0}^{\infty }{x}^{z-1}{e}^{-x}\phantom{\rule{0em}{0ex}}dx\phantom{\rule{0em}{0ex}}.$

2. Euler’s constant (also called the Euler-Mascheroni constant) is
$\gamma =\underset{n\to \infty }{lim}\left(\sum _{j=1}^{n}\frac{1}{j}-log\left(n\right)\right)\phantom{\rule{0em}{0ex}}.$

3. Gauss’s Formula for the Gamma function is
$\Gamma \left(z\right)=\underset{n\to \infty }{lim}\frac{{n}^{z}n!}{z\left(z+1\right)\left(z+2\right)\dots \left(z+n\right)}$

valid for complex values of $z\ne -1,-2,-3,\dots$.

__________________________________________________________________________ ### Mathematical Ideas

#### Stirling’s Formula in Real Variables

The Gamma function is defined as

$\Gamma \left(z\right)={\int }_{0}^{\infty }{x}^{z-1}{e}^{-x}\phantom{\rule{0em}{0ex}}dx\phantom{\rule{0em}{0ex}}.$

For an integer $n$, $\Gamma \left(n\right)=\left(n-1\right)!$ . See the proof in Lemma 1 in Stirlings Formula Derived from the Gamma Function..

Stirling’s Formula in real variables is

 $\Gamma \left(z\right)\sim {\left(\frac{z-1}{e}\right)}^{z-1}\sqrt{2\pi \left(z-1\right)}$ (1)

as $z\to \infty$.

Start with the same change of variables as in Lemma 2 of the section Stirlings Formula Derived from the Gamma Function..

Lemma 1.

$\Gamma \left(z\right)={\left(\frac{z-1}{e}\right)}^{z-1}\sqrt{2\pi \left(z-1\right)}{\int }_{-\sqrt{z-1}}^{\infty }{g}_{z-1}\left(v\right)dv\phantom{\rule{0em}{0ex}}.$

where

${g}_{z-1}\left(y\right)={\left(1+\frac{y}{\sqrt{z-1}}\right)}^{z-1}{e}^{-y\sqrt{z-1}}$

Proof. In the integral representation of $\Gamma \left(z\right)$ make the substitution $x=y\sqrt{z-1}+z-1$ (or equivalently $y=\frac{x}{\sqrt{z-1}}-\sqrt{z-1}$) with $dx=\sqrt{z-1}dy$ to give

$\begin{array}{llll}\hfill {\int }_{0}^{\infty }{x}^{z-1}{e}^{-x}\phantom{\rule{0em}{0ex}}dx& ={\int }_{-\sqrt{z-1}}^{\infty }{\left(y\sqrt{z-1}+z-1\right)}^{z-1}{e}^{-\left(y\sqrt{z-1}+z-1\right)}\phantom{\rule{0em}{0ex}}\sqrt{z-1}dy\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & ={\left(z-1\right)}^{z-1}\sqrt{z-1}{e}^{-\left(z-1\right)}{\int }_{-\sqrt{z-1}}^{\infty }{\left(y∕\sqrt{z-1}+1\right)}^{z-1}{e}^{-\left(y\sqrt{z-1}\right)}\phantom{\rule{0em}{0ex}}dy\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & ={\left(z-1\right)}^{z-1}\sqrt{z-1}{e}^{-\left(z-1\right)}{\int }_{-\sqrt{z-1}}^{\infty }{g}_{z-1}\left(y\right)\phantom{\rule{0em}{0ex}}dy\phantom{\rule{0em}{0ex}}.\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

Provided that we can show

$\underset{z\to \infty }{lim}{\int }_{-\sqrt{z-1}}^{\infty }{g}_{z-1}\left(y\right)\phantom{\rule{0em}{0ex}}dy=\underset{z\to \infty }{lim}{\int }_{-\sqrt{z-1}}^{\infty }{\left(1+\frac{y}{\sqrt{z-1}}\right)}^{z-1}{e}^{-\left(y\sqrt{z-1}\right)}\phantom{\rule{0em}{0ex}}dy=\sqrt{2\pi }$

this is Stirling’s Formula as expressed in (1).

Lemma 2. Let $L$ be a large finite value, then

$\underset{z\to \infty }{lim}{g}_{z-1}\left(v\right)={e}^{-{v}^{2}∕2}$

as $z\to \infty$, uniformly for $v\in \left[-L,L\right]$.

Remark. Compare this result to Lemma 5 of the section Stirling’s Formula Derived from the Gamma Function..

Proof. Note that ${g}_{z-1}\left(v\right)$ is defined for $v>-\sqrt{z-1}$. Fix $L$ as a large value, then

$log\left({g}_{z-1}\left(v\right)\right)=\left(z-1\right)\left[log\left(1+\frac{v}{\sqrt{z-1}}\right)-\frac{v}{\sqrt{z-1}}\right]$

is defined on the interval $\left[-L,L\right]$ as long as $-\sqrt{z-1}<-L$, or $z-1>{L}^{2}$. Then the conclusion follows from Lemma 3 in Stirling’s Formula Derived from the Gamma Function..

Alternatively,

Now letting $u=y∕\sqrt{z-1}$, we wish to show that $log\left(1+u\right)-u+{u}^{2}∕2\to 0$ as $u\to 0$. The function $log\left(1+u\right)-u+{u}^{2}∕2$ is increasing on $\left(-1,\infty \right)$ since its derivative is $1∕\left(1+u\right)-1+u\ge 0$. Then the maximum of $|log\left(1+u\right)-u+{u}^{2}∕2|$ on an interval occurs at the endpoints. If $-1<-a<0 then

$\underset{\left[-a,a\right]}{max}|log\left(1+x\right)-x+{x}^{2}∕2|=max\left\{|log\left(1-a\right)+a+{a}^{2}∕2|,|log\left(1+a\right)-a+{a}^{2}∕2|\right\}.$

Continuity of the functions $log\left(1-a\right)+a+{a}^{2}∕2$ and $log\left(1+a\right)-a+{a}^{2}∕2$ in the neighborhood of $0$ shows that $log\left(1+u\right)-u+{u}^{2}∕2\to 0$ as $u\to 0$ uniformly on $u\in \left[-L∕\sqrt{z-1},L∕\sqrt{z-1}\right]$. □

Lemma 3.

$\underset{z\to \infty }{lim}{\int }_{-\sqrt{z-1}}^{\infty }{\left(1+\frac{y}{\sqrt{z-1}}\right)}^{z-1}{e}^{-y\sqrt{z-1}}dy=\sqrt{2\pi }\phantom{\rule{0em}{0ex}}.$

Proof. Take $z$ to be a large finite value and fix $1. Then

$\begin{array}{c}{\int }_{-\sqrt{z-1}}^{\infty }{g}_{z-1}\left(y\right)dy\\ ={\int }_{-\sqrt{z-1}}^{-L}{g}_{z-1}\left(y\right)dy+{\int }_{-L}^{L}{g}_{z-1}\left(y\right)dy+{\int }_{L}^{\infty }{g}_{z-1}\left(y\right)dy\end{array}$

Using Lemma 2,

${\int }_{-L}^{L}{g}_{z-1}\left(y\right)dy\to {\int }_{-L}^{L}{e}^{-{y}^{2}∕2}dy\phantom{\rule{0em}{0ex}}.$

For temporary convenience in the proof, set

$h\left(y\right)=\left(z-1\right)\left[log\left(1+\frac{y}{\sqrt{z-1}}\right)-\frac{y}{\sqrt{z-1}}\right]$

so that ${g}_{z-1}\left(y\right)={e}^{h\left(y\right)}$. Note that

${h}^{\prime }\left(y\right)=\frac{-y\sqrt{z-1}}{\sqrt{z-1}+y}$

so that ${h}^{\prime }\left(y\right)<{h}^{\prime }\left(L\right)<0$ for $0. Note also that $h\left(y\right)\to -{y}^{2}∕2$ as $z\to \infty$. Now estimate the upper tail ${\int }_{L}^{\infty }{g}_{z-1}\left(y\right)dy={\int }_{L}^{\infty }{e}^{h\left(y\right)}dy$ by

Estimate the lower tail ${\int }_{-\sqrt{z-1}}^{-L}{e}^{h\left(y\right)}dy$. Since ${h}^{\prime }\left(-L\right)<{h}^{\prime }\left(y\right)<0$ for $-\sqrt{z-1}<-L

Taking $z$ and $L$ sufficiently large makes ${\int }_{-\sqrt{z-1}}^{\infty }{\left(1+\frac{y}{\sqrt{z-1}}\right)}^{z-1}{e}^{-y\sqrt{z-1}}dy$ as close as desired to $\sqrt{2\pi }$. □

Remark. The estimate used here is much less precise than the estimates proved in Lemma 9 in Stirling’s Formula Derived from the Gamma Function.. Therefore, the results are only asymptotic limits and not bounds.

Remark. Another derivation of the asymptotic limit for $\Gamma \left(z+1\right)$ starts with the Frullani integral representation of the digamma function. Expanding the integrand in a power series, defining the Bernoulli numbers ${B}_{n}$, and then using the definition of the Gamma function as the derivative of the logarithm of the digamma function, one can derive the asymptotic expansion

$log\left(\Gamma \left(z+1\right)\right)\sim \frac{1}{2}log\left(2\pi \right)+\left(z+\frac{1}{2}\right)log\left(z\right)-z+\frac{1}{2}\sum _{n=1}^{\infty }\frac{{B}_{2n}}{n\left(2n-1\right)}\frac{1}{{z}^{2n-1}}.$

By exponentiating both sides of this asymptotic limit we can obtain

$\Gamma \left(z+1\right)\sim \sqrt{2\pi z}{z}^{z}{e}^{-z}exp\left(\frac{1}{12z}-\frac{1}{360{z}^{2}}+\dots \phantom{\rule{0em}{0ex}}\right).$

By expressing the last exponential in a Maclaurin series, we can express this as

$\Gamma \left(z+1\right)\sim \sqrt{2\pi z}{z}^{z}{e}^{-z}\left(1+\frac{1}{12z}+\frac{1}{288{z}^{2}}+\dots \phantom{\rule{0em}{0ex}}\right).$

See  for a sketch of this proof of this asymptotic series.

#### Stirling’s Formula in Complex Variables

This section provides the statements of Stirling’s Formula for the complex variable form of the Gamma Function. This section only sketches the proofs because of the extensive background required in complex variable theory. The bibliography provides references for the proofs.

Theorem 4. The expansion of $sin\left(z\right)$ as an infinite product is

$sin\left(z\right)=z\prod _{m=1}^{\infty }\left(1-\frac{{z}^{2}}{{m}^{2}{\pi }^{2}}\right).$

Proof. See [6, page 312] for the proof. The article in the Mathworld.com article on http://mathworld.wolfram.com/Sine.html. also gives references to Edwards 2001, pages 18 and 47; and Borwein et al. 2004, page 5. □

Corollary 1 (Wallis’s Formula).

$\underset{n\to \infty }{lim}\frac{2\cdot 2\cdot 4\cdot 4\cdot 6\cdot 6\dots \left(2n\right)\cdot \left(2n\right)}{1\cdot 3\cdot 3\cdot 5\cdot 5\dots \left(2n-1\right)\cdot \left(2n-1\right)\cdot \left(2n+1\right)}=\frac{\pi }{2}.$

Proof. Substitute $z=\pi ∕2$ in the product expansion of $sin\left(z\right)$. □

Definition. Euler’s constant (also called the Euler-Mascheroni constant) is

$\gamma =\underset{n\to \infty }{lim}\left(\sum _{j=1}^{n}\frac{1}{j}-log\left(n\right)\right)\phantom{\rule{0em}{0ex}}.$

See [6, page 313] for the motivation and derivation, as well as a proof that the limit exists using the Integral Test for convergence of series. See also [7, page 190] for an alternative proof of existence by appealing to general theorems on convergence of product representations of entire functions of order 1.

Definition. Define the reciprocal of the Gamma Function as a product

$\frac{1}{\Gamma \left(z\right)}={e}^{\gamma z}z\prod _{n=1}^{\infty }\left(1+\frac{z}{n}\right){e}^{-\frac{z}{n}}$

Remark. See [6, page 313] or [7, page 192] for the justification of the construction as a meromorphic function with simple poles at the points $z=0,-1,-2,\dots$. Of course, with this definition of the Gamma function, it remains to be shown that the function satisfies the usual integral representation as in the Definition at the beginning of the section. Veech  gives the proof in Section 12, pages 195-198, Saks and Zygmund  gives a similar proof on pages 414-415.

Corollary 2.

$\Gamma \left(z\right)=\underset{n\to \infty }{lim}\frac{{n}^{z}n!}{z\left(z+1\right)\left(z+2\right)\dots \left(z+n\right)}$

Saks and Zygmund [6, page 313] say that this is known as Gauss’s Formula for the Gamma function. Veech  gives the same proof.

Corollary 3. From Gauss’s Formula it follows that

1. $\Gamma \left(z+1\right)=z\Gamma \left(z\right)$
2. $\Gamma \left(1\right)=1$
3. $\Gamma \left(n+1\right)=n!$
4. For $z$ not an integer,
$\Gamma \left(z\right)\Gamma \left(1-z\right)=\frac{\pi }{sin\left(\pi z\right)}$

5. For $z\ne 0,-\frac{1}{2},-1,\frac{3}{2},\dots$
$\Gamma \left(z\right)\Gamma \left(z+\frac{1}{2}\right)={2}^{1-2z}\sqrt{\pi }\Gamma \left(2z\right)$

which is known as Legendre’s Duplication Formula.

6. $\Gamma \left(1∕2\right)=\sqrt{\pi }$.

Proof. Veech [7, page 193] gives a proof using

$P\left(z\right)=\prod _{n=1}^{\infty }\left(1+\frac{z}{n}\right){e}^{-z∕n}$

to show $zP\left(z\right)P\left(-z\right)=sin\left(\pi z\right)∕\pi$, then reducing with Gauss’s Formula. □

Theorem 5 (Stirling’s Formula). For $0<\delta <\pi$, as $z$ goes to $\infty$ within the sector $-\pi +\delta \le argz\le \pi -\delta$

$\Gamma \left(z\right)\sim \sqrt{2\pi }{e}^{-z}{z}^{z-1∕2}.$

Proof. Saks and Zygmund  give a proof on pages 421-424 using Gauss’s Formula and a version of the Euler-Maclaurin summation formula. □

Remark. Diaconis and Freedman  mention three other proofs of the complex variable form of Stirling’s Formula for the Gamma function:

1. They cite de Bruijn,  who uses the saddlepoint method from asymptotic analysis.
2. They say that Artin, , gives a proof based on the fact that the Gamma Function is the only function which is log-convex on $\left(0,\infty \right)$, satisfies $\Gamma \left(z+1\right)=z\Gamma \left(z\right)$ and $\Gamma \left(1\right)=1$.
3. A third approach due to Lindelof in Ahlfors,  uses residue calculus from complex analysis.

#### Sources

The proof of the real variable form of Stirling’s Formula is adapted from the short article by Diaconis and Freedman, . The results on the complex variable form of the Gamma function and Stirling’s Formula are drawn from Saks and Zygmund,  and Veech, .

_______________________________________________________________________________________________ ### Problems to Work for Understanding

1. Show that
$\underset{z\to \infty }{lim}{g}_{z-1}\left(v\right)={e}^{-{v}^{2}∕2}$

as $z\to \infty$, uniformly on $\left[-L,L\right]$ follows from Lemma 3 in Stirling’s Formula Derived from the Gamma Function.

2. Given $ϵ>0$ show that there is a value $Z$ so large that
$\left|{\int }_{-\sqrt{z-1}}^{\infty }{\left(1+\frac{y}{\sqrt{z-1}}\right)}^{z-1}{e}^{-y\sqrt{z-1}}dy-\sqrt{2\pi }\right|\phantom{\rule{0em}{0ex}}.$

for $z>Z$.

3. Prove $\Gamma \left(z+1\right)=z\Gamma \left(z\right)$ by using Gauss’s Formula.
4. Prove $\Gamma \left(1\right)=1$ by using Gauss’s Formula.
5. Show that
$\Gamma \left(n+\frac{1}{2}\right)=\frac{\left(2n\right)!}{{2}^{2n}n!}\sqrt{\pi }$

and in particular that $\Gamma \left(\frac{1}{2}\right)=\frac{1}{2}\sqrt{\pi }$.

__________________________________________________________________________ ### References

   L. Ahlfors. Complex Analysis. McGraw Hill, 3rd edition, 1979.

   Larry C. Andrews. Special Functions for Engineers and Applied Mathematicians. MacMillan, 1985.

   E. Artin. The Gamma Function. Holt, Rinehart, Winston, 1964.

   N. G. de Bruijn. Asymptotic Methods in Analysis. Dover, 1981.

   P. Diaconis and D. Freedman. An elmentary proof of Stirling’s formula. American Mathematical Monthly, 93:123–126, 1986.

   S. Saks and A. Zygmund. Analytic Functions. Elsevier Publishing, 1971.

   William A. Veech. A Second Course in Complex Analysis. W. A. Benjamin Inc., New York, 1967.

__________________________________________________________________________ __________________________________________________________________________

I check all the information on each page for correctness and typographical errors. Nevertheless, some errors may occur and I would be grateful if you would alert me to such errors. I make every reasonable effort to present current and accurate information for public use, however I do not guarantee the accuracy or timeliness of information on this website. Your use of the information from this website is strictly voluntary and at your risk.

I have checked the links to external sites for usefulness. Links to external websites are provided as a convenience. I do not endorse, control, monitor, or guarantee the information contained in any external website. I don’t guarantee that the links are active at all times. Use the links here with the same caution as you would all information on the Internet. This website reflects the thoughts, interests and opinions of its author. They do not explicitly represent official positions or policies of my employer.

Information on this website is subject to change without notice.