Chapter 2: Gamma Function

NOTE: Math will not display properly in Safari - please use another browser

The material covered in this chapter is also presented in Boas Chapter 11, Sections 3, 4, and 5.

2.1 Introduction

A sphere in three-dimensional space can be defined by the equation x2+y2+z2=R2, where R is the sphere's radius. The volume of this sphere is well known to be given by V3=(4π/3)R3; the subscript 3 attached to V is there to remind us that the result is valid for a three-dimensional sphere.

It is possible to derive an analogous expression for the ``volume'' of a ``sphere'' in any number of dimensions. A simple example is the two-dimensional ``sphere'' defined by x2+y2=R2 --- you will recognize this as the equation of a circle. In this case the ``volume'' of the ``sphere'' --- the surface area of the circle --- is obviously V2=πR2. Notice that we now use a subscript 2 to emphasize that the result pertains to a two-dimensional object. Notice also that the scaling with R has changed, from R3 in three dimensions to R2 in two dimensions, and that the numerical coefficient is also different.

Another example involves a ``sphere'' in four dimensions. In this case we define the object by the equation x2+y2+z2+u2=R2, where u is the coordinate associated with the fourth dimension, and the ``volume'' is given by V4=(π2/2)R4. Notice the scaling with R4 and the numerical coefficient. All these examples (and more) are summarized in Table 2.1.

Dimension Equation of Sphere Volume of Sphere
2

x2+y2=R2

V2=πR2

3

x2+y2+z2=R2

V3=(4π/3)R3

4

x2+y2+z2+u2=R2

V4=(π2/2)R4

5

x2+y2+z2+u2+v2=R2

V5=(8π2/15)R5

6

x2+y2+z2+u2+v2+w2=R2

V6=(π3/6)R6

Table 2.1: Volume of a sphere in n-dimensions.

We would like to obtain a general expression for the ``volume'' of a ``sphere'' in any number of dimensions. For this we require a new tool, the Gamma function, to be introduced in this chapter. We will come back to this discussion in Sec.2.5, once the tool has found its proper place in our mathematical toolbox.

You may think that the volume of an n-dimensional sphere is nothing more than a mathematical curiosity. This is not so. Higher-dimensional spaces are featured in many areas of physics. A prominent example is the ``phase space'' of classical mechanics, the abstract mathematical space that consists of all positions and momenta for a collection of particles. A single particle in ordinary, three-dimensional space has three components for its position vector, three components for its momentum vector, and its phase space is therefore six-dimensional. A collection of N particles requires the specification of 3N coordinates to determine all positions, and the specification of 3N additional coordinates to determine the momenta; the phase space of this collection is 6N-dimensional. When, for example, the collection describes a single mole of an ideal gas, N=6.02×1023, and the dimensionality of phase space is astronomically large.

It is the business of statistical mechanics to deal with such large collections of particles. The name of the game is to coarse-grain the description of the system so as to discard the detailed information about each particle's position and momentum, to retain only the information that's macroscopically relevant, such as the gas' pressure, energy, temperature, entropy, and so on. To do this, one defines a number of operations to be carried out in phase space. A very useful operation is to calculate the volume of a region of phase space that corresponds to a collection of particles with a total energy bounded by a certain value E. By rescaling the positions and momenta, the region can be given the shape of a sphere in an 6N-dimensional space, and the operation therefore consists of calculating Vn for this number of dimensions. A lot of physics comes out of this, and it is therefore very worthwhile to calculate the volume of a sphere in any dimension n. (Plus, it is a really cool mathematical curiosity!)

2.2 Factorial Notation

Before we introduce the Gamma function in Sec.2.3, we review the closely related factorial notation. For any positive integer n we let

n!:=(n)(n1)(n2)(1).

For example, 5!=(5)(4)(3)(2)(1)=120. The definition can be extended to n=0 by declaring that 0!:=1. The factorial of a negative integer is not defined.

The double factorial notation n!! is also in wide use. For an even integer, this is defined by

n!!:=(n)(n2)(n4)(2),

while

n!!:=(n)(n2)(n4)(1)

for an odd integer. For example, 5!!=(5)(3)(1)=15, and 6!!=(6)(4)(2)=48. Notice that n!! is not equal to (n!)!, as the notation might suggest.

The double factorial can always be expressed in terms of the single factorial. Suppose first that we are dealing with an even integer, which we write as 2n for some (even or odd) n. Calculating (2n)!! yields

(2n)!!=(2n)(2n2)(2n4)(2)=2?n(n1)(n2)(1),

where we extracted a common factor of 2 from each factor in the product. The number of such factors is easily seen to be equal to n, so that ?=n. We have obtained

(2n)!!=2nn!,

the required relation for the double factorial of an even integer.

For an odd integer we proceed differently. We first express the integer as 2n+1 for some n, and write

(2n+1)!!=(2n+1)(2n1)(2n3)(1)=(2n+1)(2n)(2n1)(2n2)(2n3)(2n4)(2)(1)(2n)(2n2)(2n4)(2)=(2n+1)!(2n)!!.

We next insert Eq.(2.5) and obtain

(2n+1)!!=(2n+1)!2nn!,

the required relation for the double factorial of an odd integer.

2.3 Gamma Function

The Gamma function Γ(x) is a function of a real variable x that can be either positive or negative. For x positive, the function is defined to be the numerical outcome of evaluating a definite integral,

Γ(x):=0tx1etdt(x>0).

Notice that the variable x, the argument of the Gamma function, appears as a parameter inside the integral. The variable t is the variable of integration, and it can be renamed at will without changing the value of the integral; for example, the Gamma function can equally well be written as Γ(x):=0px1epdp. The integral is defined for x>0 only; for x0 the factor tx1 inside the integral blows up when t0 and prevents the integral from converging. (The factor continues to blow up when 0<x<1, but in this case the integral is still well defined.) The definition of the Gamma function will be extended to negative values of x below. It is also possible to extend the Gamma function to the complex plane, but we shall not pursue this here. In general the integral of Eq.(2.8) must be evaluated numerically, but as we shall see below, the integral can be performed analytically for some specific values of x. A plot of the Gamma function is displayed in Fig.2.1.

""
Figure 2.1: Gamma function

By far the most important property of the Gamma function is the recursion relation

Γ(x+1)=xΓ(x).

This is useful, because if the integral can be evaluated for some x, then there is no need to repeat the exercise for x+1; one simply uses the recursion relation, and keeps on using it for x+2, x+3, and so on. To establish Eq.(2.9) we continue to assume that x>0, we write

Γ(x+1)=0txetdt,

and we perform an integration by parts. We let u:=tx and dv:=etdt, so that txetdt=udv=d(uv)vdu. The assignments imply that du=xtx1dt and v=et, and making the substitutions yield

Γ(x+1)=txet|00(et)(xtx1dt).

The boundary term at t= vanishes because of the exponentialfactor, and the one at t=0 vanishes because x>0. We are left with

Γ(x+1)=x0tx1etdt

after pulling x out of the integral, which is recognized as Γ(x) from Eq.(2.8). We have obtained the recursion relation of Eq.(2.9).

The recursion relation can be used to extend the definition of the Gamma function to negative values of x. Suppose first that x is in the interval 1<x0. Because x is negative, the integral of Eq.(2.8) does not converge, and a priori, the Gamma function is not defined for this value of x. But Eq.(2.9) can be expressed as

Γ(x)=Γ(x+1)x,

and because x+1 is positive, the Gamma function on the right-hand side is perfectly well defined. The right-hand side, therefore, assigns a meaningful value to Γ(x). This is how we extend the definition of the Gamma function from x>0 to the interval 1<x0: we simply let the recursion relation provide the values of the Gamma function in this interval.

The procedure can be extended to the next internal, 2<x1. In this case we let xx+1 in the recursion relation, and write

Γ(x+1)=Γ(x+2)x+1.

If we next combine this with our previous expression for Γ(x), we obtain

Γ(x)=Γ(x+2)x(x+1),

and observe that since x+2 is positive, the right-hand side is well defined and assigns a meaningful value to Γ(x). In this case the original definition of the Gamma function was extended to the interval 2<x1 by two applications of the recursion relation. The procedure can be extended indefinitely to define the Gamma function everywhere on the negative x axis.

2.4 Special Values

It is easy to evaluate the Gamma function for x=1. In this specific case the definition of Eq.(2.8) returns Γ(1)=0etdt, and the integral can be evaluated directly. This gives

Γ(1)=1.

The recursion relation of Eq.(2.9) allows us to find values for all other integers. Setting x=1 in that equation returns Γ(2)=(1)Γ(1)=1. With x=2 we get Γ(3)=(2)Γ(2)=(2)(1)=2. Now let's try x=3, and find Γ(4)=(3)Γ(3)=(3)(2)(1)=6. A clear pattern is emerging, and we conclude that for any integer n,

Γ(n)=(n1)!.

Letting nn+1 in this equation produces the alternative form n!=Γ(n+1). So for an integer argument, we see that the Gamma function reduces to the factorial function.

The recursion relation can be applied in the opposite direction. Letting x=0 in Eq.(2.13) implies that Γ(0)=1/0=, so that the Gamma function diverges at x=0. Similarly, letting x=1 in Eq.(2.15) yields Γ(1)=1/(0)=, so that the Gamma function also diverges at x=1. It is easy to see that this phenomenon will occur for all negative integers: Γ(x) diverges for x=0,1,2,3,. This behaviour can be seen in the graph displayed in Fig.~???.

A particular interesting result is the value of the Gamma function for x=1/2. We shall show presently that

Γ(1/2)=π.

Again this result can be used to seed the recursion relation. For example, you can verify that Γ(3/2)=12π, Γ(5/2)=34π, as well as Γ(1/2)=2π and Γ(3/2)=43π.


Exercise 2.1: Verify these values.



Exercise 2.2: Prove that

Γ(n+1/2)=(2n1)!!2nπ,

where n is any positive integer.


To establish Eq.(2.18) we begin with the definition of Eq.(2.8), which returns

Γ(1/2)=0t1/2etdt./tag2.20

To help us evaluate this integral, we perform the change of variables t=x2, letting x be the new integration variable, which also ranges from x=0 to x=. (Note that in this discussion, x no longer stands for the argument of the Gamma function, which is now fixed to 1/2.) Performing the transformation yields

Γ(1/2)=20ex2dx=ex2dx;

in the second step we allowed ourselves to extend the domain of integration to the whole line, at the cost of the factor of 2, because the integrand is an even function of x. Unfortunately this integral is still too hard to be evaluated directly.

To overcome this difficulty we employ a devious trick. Instead of calculating Γ(1/2) directly, let us agree to calculate its square. This is given by

[Γ(1/2)]2=(ex2dx)(ey2dy),

where we have placed a second copy of the integral next to the first, but with the variable of integration changed to y. Alternatively, this can be written as the double integral

[Γ(1/2)]2=ex2ey2dxdy,

or as

[Γ(1/2)]2=e(x2+y2)da

with da standing for the area element dxdy, and with the domain of integration understood to be the entire x-y plane. In this last form, the integral is written as a two-dimensional integral over the plane.

Why is this progress? Because we may now simplify the form of the integral by switching to polar coordinates (refer back to Sec.~???). We write x=scosϕ, y=ssinϕ, da=sdsdϕ, and notice that in the new coordinates, the integrand is independent of the angular variable ϕ. The transformation yields

[Γ(1/2)]2=0es2sds2π0dϕ=2π0es2sds.

To perform the remaining integral we let s=t1/2, so that ds=12t1/2dt. Making the change of variables produces

0es2sds=120etdt=12,

and we have arrived at [Γ(1/2)]2=π, the same statement as Eq.(2.18). Clever trick, you say?

2.5 Volume of Sphere in n Dimensions

We may now return to the topic that opened the chapter and motivated the introduction of the Gamma function. We wish to calculate Vn, the volume of an n-dimensional sphere. Introducing Cartesian coordinates (x1,x2,x3,,xn) to describe the n-dimensional space, the sphere is defined by the equation

x21+x22+x23++x2n=R2,

where R is the sphere's radius. On dimensional grounds it should be obvious that Vn will be proportional to Rn. To express this we write

Vn=CnRn,

where Cn is a number independent of R. We wish to obtain this number, for any dimension n.

We shall again employ a devious trick. Instead of answering the question directly, we shall instead aim to evaluate the multi-dimensional integral

In:=e(x21+x22+x23++x2n)dV,

where dV:=dx1dx2dx3dxn is the volume element of the n-dimensional space. A more explicit expression of the same integral is

In=e(x21+x22++x2n)dx1dx2dxn,

or

In=(ex21dx1)(ex22dx2)(ex2ndxn),

or even

In=(ex21dx1)n.

The steps that led us from Eq.(2.29) to Eq.(2.32) are virtually identical to those involved previously in the computation of [Γ(1/2)]2. Additional similarities between the two discussions will be observed below.

To see how we can calculate In for a general value of n, let us first examine the specific case n=2. Let us, therefore, evaluate the two-dimensional integral

I2=e(x21+x22)dV,

where dV:=dx1dx2 is the area element and the domain of integration is the entire two-dimensional plane. We actually did this at the end of Sec.2.4, and found the integral to be equal to π, but we shall now look at it from a slightly different point of view.

""
Figure 2.2: Integration of an angle-independent function over the two-dimensional plane. The plane is scanned with circular strips of radius R and thickness dR

The function to be integrated is e(x21x22), and when we evaluate the function on the circle x21+x22=R2 --- this is the two-dimensional version of our n-dimensional sphere --- we get the constant eR2. The important point is that while the value of the function depends on the size of the circle, it is actually independent of position on the circle. In terms of the polar coordinates introduced previously, with R playing the role of the radial coordinate s, the function depends on R but is independent of the angle ϕ. This observation suggests a promising strategy to evaluate the integral, as illustrated in Fig.2.2. We can take advantage of the fact that the function is independent of position on each circle R=constant to integrate it over the entire plane. The idea is to scan the plane with circular strips of radius R and infinitesimal thickness dR, letting R range from its smallest value of 0 to its largest value of . On each strip the function is equal to the constant eR2, and the contribution to the integral from each strip is eR2dV2, with dV2 denoting the surface area of the strip. The integral can therefore be written as

I2=0eR2dV2,

with the understanding that the variable of integration is R. What the strategy has achieved is to reduce the two-dimensional integral to a single integration over R; by scanning the plane with circular strips we have implicitly carried out the integral over the angle ϕ.

To give I2 a concrete form we must still relate dV2 to dR. The area element dV2 is defined to be the area of a circular strip of radius R and thickness dR, and this can be written as the difference between the area of a circle of radius R+dR and the area of a circle of radius R. In mathematical terms,

dV2=V2(R+dR)V2(R),

where V2 is the area function of a circle --- the two-dimensional version of the volume function Vn. Because dR is infinitesimal we can write this as

dV2=dV2dRdR,

where dV2/dR is the derivative of the area function with respect to R. Because V2=πR2, we have that dV2=2πRdR, and our integral becomes

I2=2π0eR2RdR.

This can be evaluated as we did previously, and we confirm that I2=π.

The two-dimensional integration strategy can easily be adapted to any number of dimensions to evaluate In, as defined by Eq.(2.29). The function to be integrated is now e(x21+x22++x2n),

and this function is constant on the n-dimensional sphere defined by Eq.(2.27). So while the function depends on the radius R of the sphere, it is independent of position on this sphere. This independence compels us to scan the n-dimensional space with spherical shells of radius R and thickness dR, letting R range from 0 to . We therefore express the integral as

In=0eR2dVn,

with dVn denoting the volume of each spherical shell. With the notation introduced at the beginning of the section, this is

dVn=Vn(R+dR)Vn(R)=dVndRdR,

where Vn(R) is the volume of an n-dimensional sphere of radius R.

At this stage we seem to be stuck, because we don't know Vn(R), the very quantity this calculation is supposed to reveal. But we can still make progress, because we do know that it takes the form Vn=CnRn, with Cn an unknown number independent of R. With this we have that dVn=nCnRn1dR, and the integral becomes

In=nCn0eR2Rn1dR.

The transformation R=t1/2 brings this to the new form

In=12nCn0tn/21etdt,

and the integral is happily recognized as a Gamma function of argument x=n/2. We conclude that

In=12nCnΓ(n/2).


Exercise 2.3: Reproduce the steps that led us to Eq.(2.42), especially those that concern the transformation of variables from R to t.


We have successfully evaluated the multi-dimensional integral In, but it is still expressed in terms of the unknown Cn, the quantity we have been after all along. Fortunately there is another (and much simpler) way to evaluate In, and we can use this additional piece of information to finally solve for Cn. This last step will bring the discussion to a close.

Let us return to Eq.(2.32), and observe that the equation immediately implies that In=(I1)n, because the integral appearing within the round brackets is precisely= I1. Setting n=2 yields I2=(I1)2, and since we know that I2=π, we have that I1=π. This, finally, implies that

In=πn/2.

We may now combine Eqs.(2.42) and (2.43) and solve for Cn. This gives

Cn=2πn/2nΓ(n/2)=πn/2(n/2)Γ(n/2)=πn/2Γ(n/2+1),

where we used the recursion relation of Eq.(2.9) in the last step.

After this long, circuitous route, we have finally obtained an expression for the volume of an n-dimensional sphere. It is given by

Vn=πn/2Γ(n/2+1)Rn.

This expression incorporates the expected scaling with Rn, but more importantly, it identifies the constant factor in front. And this constant can indeed be written in terms of the Gamma function.


Exercise 2.4: Verify that the explicit expressions for Vn listed in Table 2.1 all agree with Eq.(2.45). <\p>


2.6 Practice Problems

  1.  Find the numerical values of Γ(1.3), Γ(2.8), and Γ(0.4).
  2.  (Boas Chapter 11, Section 3, Problem 2) Evaluate Γ(2/3)/Γ(5/3).

  3. (Boas Chapter 11, Section 3, Problem 3) Evaluate Γ(2/3)/Γ(8/3).

  4. (Boas Chapter 11, Section 3, Problem 8) Evaluate the integral 0x2/3exdx.

  5. (Boas Chapter 11, Section 3, Problem 9) Evaluate the integral 0ex4dx.

  6. (Boas Chapter 11, Section 3, Problem 11) Evaluate the integral 0x5ex2dx.

  7. (Boas Chapter 11, Section 3, Problem 14) Evaluate the integral 10[ln(x)]1/3dx.

  8. Find an expression, analogous to Eq.(2.19), for Γ(n+1/2), where n is a positive integer.

2.7 Challenge Problems

  1. An ideal gas consisting of molecules of mass m is in thermal equilibrium at a temperature T. A famous result of statistical mechanics is that for this gas, the fraction df of molecules that have speeds in the interval between v and v+dv is given by

     

    df=4π(m2πkT)3/2v2exp(mv22kT)dv,

    where k is Boltzmann's constant. Calculate

    vn=0vndf,

    the average value of vn among all the molecules (n is any positive integer). Simplify your result as much as possible and check your units. What is 12mv2, the average kinetic energy?

  2. In statistics, the gamma distribution is described by

    p(x)=βαΓ(α)xα1eβx

    where α and β are parameters. The probability distribution function p(x) is defined such that the probability of measuring the random variable to be in the interval between x and x+dx is given by p(x)dx. Here it is understood that x0: the random variable takes positive values only. In your answers below, simplify your result as much as possible.

    a) Verify that the distribution function is normalized, 0p(x)dx=1.

    b) Calculate the mean μ=x.

    c) Calculate the variance σ2=(xμ)2.

    d) Calculate the skewness γ=[(xμ)/σ]3.