# 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 $x^2 + y^2 + z^2 = R^2$, where $R$ is the sphere's radius. The volume of this sphere is well known to be given by $V_3 = (4\pi/3) R^3$; 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 $x^2 + y^2 = R^2$ --- 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 $V_2 = \pi R^2$. 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 $R^3$ in three dimensions to $R^2$ 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 $x^2 + y^2 + z^2 + u^2 = R^2$, where $u$ is the coordinate associated with the fourth dimension, and the volume'' is given by $V_4 = (\pi^2/2) R^4$. Notice the scaling with $R^4$ and the numerical coefficient. All these examples (and more) are summarized in Table 2.1.

 Dimension Equation of Sphere Volume of Sphere 2 $x^2 + y^2 = R^2$ $V_2 = \pi R^2$ 3 $x^2 + y^2 + z^2 = R^2$ $V_3 = (4\pi/3) R^3$ 4 $x^2 + y^2 + z^2 + u^2 = R^2$ $V_4 = (\pi^2/2) R^4$ 5 $x^2 + y^2 + z^2 + u^2 + v^2 = R^2$ $V_5 = (8\pi^2/15) R^5$ 6 $x^2 + y^2 + z^2 + u^2 + v^2 + w^2 = R^2$ $V_6 = (\pi^3/6) R^6$

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 \times 10^{23}$, 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 $V_n$ 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)(n-1)(n-2) \cdots (1). \tag{2.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)(n-2)(n-4) \cdots (2), \tag{2.2}$$

while

$$n!! := (n)(n-2)(n-4) \cdots (1) \tag{2.3}$$

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)(2n-2)(2n-4) \cdots (2) = 2^{?} n(n-1)(n-2) \cdots (1), \tag{2.4}$$

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)!! = 2^n n!, \tag{2.5}$$

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

\begin{align} (2n+1)!! &= (2n+1)(2n-1)(2n-3) \cdots (1) \nonumber \\ &= \frac{(2n+1)(2n)(2n-1)(2n-2)(2n-3)(2n-4) \cdots (2)(1)} {(2n)(2n-2)(2n-4) \cdots (2)} \nonumber \\ &= \frac{(2n+1)!}{(2n)!!}. \tag{2.6} \end{align}

We next insert Eq.(2.5) and obtain

$$(2n+1)!! = \frac{(2n+1)!}{2^n n!},\tag{2.7}$$

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

## 2.3 Gamma Function

The Gamma function $\Gamma(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,

$$\Gamma(x) := \int_0^\infty t^{x-1} e^{-t}\, dt \qquad (x > 0). \tag{2.8}$$

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 $\Gamma(x) := \int_0^\infty p^{x-1} e^{-p}\, dp$. The integral is defined for $x>0$ only; for $x \leq 0$ the factor $t^{x-1}$ inside the integral blows up when $t \to 0$ 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.

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

$$\Gamma(x+1) = x \Gamma(x). \tag{2.9}$$

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

$$\Gamma(x+1) = \int_0^\infty t^x e^{-t}\, dt, \tag{2.10}$$

and we perform an integration by parts. We let $u := t^x$ and $dv := e^{-t}\, dt$, so that $t^x e^{-t}\, dt = u\, dv = d(uv) - v\, du$. The assignments imply that $du = x t^{x-1}\, dt$ and $v = -e^{-t}$, and making the substitutions yield

$$\Gamma(x+1) = - t^x e^{-t} \biggr|^\infty_0 - \int_0^\infty (-e^{-t})( x t^{x-1}\, dt ). \tag{2.11}$$

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

$$\Gamma(x+1) = x \int_0^\infty t^{x-1} e^{-t}\, dt \tag{2.12}$$

after pulling $x$ out of the integral, which is recognized as $\Gamma(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 < x \leq 0$. 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

$$\Gamma(x) = \frac{\Gamma(x+1)}{x}, \tag{2.13}$$

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 $\Gamma(x)$. This is how we extend the definition of the Gamma function from $x>0$ to the interval $-1 < x \leq 0$: 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 < x \leq -1$. In this case we let $x \to x + 1$ in the recursion relation, and write

$$\Gamma(x+1) = \frac{\Gamma(x+2)}{x+1}. \tag{2.14}$$

If we next combine this with our previous expression for $\Gamma(x)$, we obtain

$$\Gamma(x) = \frac{\Gamma(x+2)}{x(x+1)}, \tag{2.15}$$

and observe that since $x+2$ is positive, the right-hand side is well defined and assigns a meaningful value to $\Gamma(x)$. In this case the original definition of the Gamma function was extended to the interval $-2 < x \leq -1$ 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 $\Gamma(1) = \int_0^\infty e^{-t}\, dt$, and the integral can be evaluated directly. This gives

$$\Gamma(1) = 1. \tag{2.16}$$

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

$$\Gamma(n) = (n-1)!. \tag{2.17}$$

Letting $n \to n+1$ in this equation produces the alternative form $n! = \Gamma(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 $\Gamma(0) = 1/0 = \infty$, so that the Gamma function diverges at $x=0$. Similarly, letting $x=-1$ in Eq.(2.15) yields $\Gamma(-1) = 1/(-0) = -\infty$, so that the Gamma function also diverges at $x=-1$. It is easy to see that this phenomenon will occur for all negative integers: $\Gamma(x)$ diverges for $x = 0, -1, -2, -3, \cdots$. This behaviour can be seen in the graph displayed in Fig.~\ref{fig2:Gamma}.

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

$$\Gamma(1/2) = \sqrt{\pi}. \tag{2.18}$$

Again this result can be used to seed the recursion relation. For example, you can verify that $\Gamma(3/2) = \frac{1}{2} \sqrt{\pi}$, $\Gamma(5/2) = \frac{3}{4} \sqrt{\pi}$, as well as $\Gamma(-1/2) = -2\sqrt{\pi}$ and $\Gamma(-3/2) = \frac{4}{3} \sqrt{\pi}$.

Exercise 2.1: Verify these values.

Exercise 2.2: Prove that

$$\Gamma(n + 1/2) = \frac{(2n-1)!!}{2^n}\, \sqrt{\pi}, \tag{2.19}$$

where $n$ is any positive integer.

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

$$\Gamma(1/2) = \int_0^\infty t^{-1/2} e^{-t}\, dt. /tag{2.20}$$

To help us evaluate this integral, we perform the change of variables $t = x^2$, letting $x$ be the new integration variable, which also ranges from $x=0$ to $x = \infty$. (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

$$\Gamma(1/2) = 2 \int_0^\infty e^{-x^2}\, dx = \int_{-\infty}^\infty e^{-x^2}\, dx; \tag{2.21}$$

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 $\Gamma(1/2)$ directly, let us agree to calculate its square. This is given by

$$\bigl[ \Gamma(1/2) \bigr]^2 = \biggl( \int_{-\infty}^\infty e^{-x^2}\, dx \biggr) \biggl( \int_{-\infty}^\infty e^{-y^2}\, dy \biggr), \tag{2.22}$$

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

$$\bigl[ \Gamma(1/2) \bigr]^2 = \int_{-\infty}^\infty \int_{-\infty}^\infty e^{-x^2} e^{-y^2}\, dx dy, \tag{2.23}$$

or as

$$\bigl[ \Gamma(1/2) \bigr]^2 = \int e^{-(x^2+y^2)}\, da \tag{2.24}$$

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.~\ref{sec1:polar}). We write $x = s\cos\phi$, $y = s\sin\phi$, $da = sds\, d\phi$, and notice that in the new coordinates, the integrand is independent of the angular variable $\phi$. The transformation yields

$$\bigl[ \Gamma(1/2) \bigr]^2 = \int_0^\infty e^{-s^2} s\, ds \int_0^{2\pi} d\phi = 2\pi \int_0^\infty e^{-s^2} s\, ds. \tag{2.25}$$

To perform the remaining integral we let $s = t^{1/2}$, so that $ds = \frac{1}{2} t^{-1/2}\, dt$. Making the change of variables produces

$$\int_0^\infty e^{-s^2} s\, ds = \frac{1}{2} \int_0^\infty e^{-t}\, dt = \frac{1}{2}, \tag{2.26}$$

and we have arrived at $[\Gamma(1/2)]^2 = \pi$, 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 $V_n$, the volume of an $n$-dimensional sphere. Introducing Cartesian coordinates $(x_1, x_2, x_3, \cdots, x_n)$ to describe the $n$-dimensional space, the sphere is defined by the equation

$$x_1^2 + x_2^2 + x_3^2 + \cdots + x_n^2 = R^2, \tag{2.27}$$

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

$$V_n = C_n R^n, \tag{2.28}$$

where $C_n$ 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

$$I_n := \int e^{-(x_1^2 + x_2^2 + x_3^2 + \cdots + x_n^2)}\, dV, \tag{2.29}$$

where $dV := dx_1 dx_2 dx_3 \cdots dx_n$ is the volume element of the $n$-dimensional space. A more explicit expression of the same integral is

$$I_n = \int_{-\infty}^\infty \int_{-\infty}^\infty \cdots \int_{-\infty}^\infty e^{-(x_1^2 + x_2^2 + \cdots + x_n^2)}\, dx_1 dx_2 \cdots dx_n, \tag{2.30}$$

or

$$I_n = \biggl( \int_{-\infty}^\infty e^{-x_1^2}\, dx_1 \biggr) \biggl( \int_{-\infty}^\infty e^{-x_2^2}\, dx_2 \biggr) \cdots \biggl( \int_{-\infty}^\infty e^{-x_n^2}\, dx_n \biggr), \tag{2.31}$$

or even

$$I_n = \biggl( \int_{-\infty}^\infty e^{-x_1^2}\, dx_1 \biggr)^n. \tag{2.32}$$

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

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

$$I_2 = \int e^{-(x_1^2+x_2^2)}\, dV, \tag{2.33}$$

where $dV := dx_1 dx_2$ 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 $\pi$, but we shall now look at it from a slightly different point of view.

The function to be integrated is $e^{-(x_1^2-x_2^2)}$, and when we evaluate the function on the circle $x_1^2 + x_2^2 = R^2$ --- this is the two-dimensional version of our $n$-dimensional sphere --- we get the constant $e^{-R^2}$. 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 $\phi$. 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 = \mbox{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 $\infty$. On each strip the function is equal to the constant $e^{-R^2}$, and the contribution to the integral from each strip is $e^{-R^2}\, dV_2$, with $dV_2$ denoting the surface area of the strip. The integral can therefore be written as

$$I_2 = \int_0^\infty e^{-R^2}\, dV_2, \tag{2.34}$$

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 $\phi$.

To give $I_2$ a concrete form we must still relate $dV_2$ to $dR$. The area element $dV_2$ 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,

$$dV_2 = V_2(R + dR) - V_2(R), \tag{2.35}$$

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

$$dV_2 = \frac{dV_2}{dR}\, dR, \tag{2.36}$$

where $dV_2/dR$ is the derivative of the area function with respect to $R$. Because $V_2 = \pi R^2$, we have that $dV_2 = 2\pi R\, dR$, and our integral becomes

$$I_2 = 2\pi \int_0^\infty e^{-R^2} R\, dR. \tag{2.37}$$

This can be evaluated as we did previously, and we confirm that $I_2 = \pi$.

The two-dimensional integration strategy can easily be adapted to any number of dimensions to evaluate $I_n$, as defined by Eq.(2.29). The function to be integrated is now $e^{-(x_1^2 + x_2^2 + \cdots + x_n^2)},$

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 $\infty$. We therefore express the integral as

$$I_n = \int_0^\infty e^{-R^2}\, dV_n, \tag{2.38}$$

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

$$dV_n = V_n(R+dR) - V_n(R) = \frac{dV_n}{dR}\, dR, \tag{2.39}$$

where $V_n(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 $V_n(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 $V_n = C_n R^n$, with $C_n$ an unknown number independent of $R$. With this we have that $dV_n = n C_n R^{n-1}\, dR$, and the integral becomes

$$I_n = n C_n \int_0^\infty e^{-R^2}\, R^{n-1}\, dR. \tag{2.40}$$

The transformation $R = t^{1/2}$ brings this to the new form

$$I_n = \frac{1}{2} n C_n \int_0^\infty t^{n/2-1} e^{-t}\, dt, \tag{2.41}$$

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

$$I_n = \frac{1}{2} n C_n \Gamma(n/2). \tag{2.42}$$

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 $I_n$, but it is still expressed in terms of the unknown $C_n$, the quantity we have been after all along. Fortunately there is another (and much simpler) way to evaluate $I_n$, and we can use this additional piece of information to finally solve for $C_n$. 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 $I_n = (I_1)^n$, because the integral appearing within the round brackets is precisely= $I_1$. Setting $n=2$ yields $I_2 = (I_1)^2$, and since we know that $I_2 = \pi$, we have that $I_1 = \sqrt{\pi}$. This, finally, implies that

$$I_n = \pi^{n/2}. \tag{2.43}$$

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

$$C_n = \frac{2 \pi^{n/2}}{n \Gamma(n/2)} = \frac{\pi^{n/2}}{(n/2) \Gamma(n/2)} = \frac{\pi^{n/2}}{\Gamma(n/2+1)},\tag{2.44}$$

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

$$V_n = \frac{\pi^{n/2}}{\Gamma(n/2+1)}\, R^n. \tag{2.45}$$

This expression incorporates the expected scaling with $R^n$, 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 $V_n$ listed in Table 2.1 all agree with Eq.(2.45). <\p>

## 2.6 Practice Problems

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

3. (Boas Chapter 11, Section 3, Problem 3) Evaluate $\Gamma(2/3)/\Gamma(8/3)$.

4. (Boas Chapter 11, Section 3, Problem 8) Evaluate the integral $\int_0^\infty x^{2/3} e^{-x}\, dx$.

5. (Boas Chapter 11, Section 3, Problem 9) Evaluate the integral $\int_0^\infty e^{-x^4}\, dx$.

6. (Boas Chapter 11, Section 3, Problem 11) Evaluate the integral $\int_0^\infty x^5 e^{-x^2}\, dx$.

7. (Boas Chapter 11, Section 3, Problem 14) Evaluate the integral $\int_0^1 [\ln(x)]^{1/3}\, dx$.

8. Find an expression, analogous to Eq.(2.19), for $\Gamma(-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\pi \biggl( \frac{m}{2\pi k T} \biggr)^{3/2} v^2\exp\biggl( -\frac{mv^2}{2kT} \biggr)\, dv,$

where $k$ is Boltzmann's constant. Calculate

$\langle v^n \rangle = \int_0^\infty v^n\, df,$

the average value of $v^n$ among all the molecules ($n$ is any positive integer). Simplify your result as much as possible and check your units. What is $\langle \frac{1}{2} m v^2 \rangle$, the average kinetic energy?

2. In statistics, the gamma distribution is described by

$p(x) = \frac{\beta^\alpha}{\Gamma(\alpha)} x^{\alpha-1}e^{-\beta x}\,$

where $\alpha$ and $\beta$ 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 $x \geq 0$: 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, $\int_0^\infty p(x)\, dx = 1$.

b) Calculate the mean $\mu = \langle x \rangle$.

c) Calculate the variance $\sigma^2 = \langle (x-\mu)^2 \rangle$.

d) Calculate the skewness $\gamma = \langle [(x-\mu)/\sigma]^3 \rangle$.