# 5.15: The Maxwell Distribution

- Page ID
- 10355

The Maxwell distribution, named for James Clerk Maxwell, is the distribution of the magnitude of a three-dimensional random vector whose coordinates are independent, identically distributed, mean 0 normal variables. The distribution has a number of applications in settings where magnitudes of normal variables are important, particularly in physics. It is also called the Maxwell-Boltzmann distribution in honor also of Ludwig Boltzmann. The Maxwell distribution is closely related to the Rayleigh distribution, which governs the magnitude of a two-dimensional random vector whose coordinates are independent, identically distributed, mean 0 normal variables.

## The Standard Maxwell Distribution

### Definition

Suppose that \(Z_1\), \(Z_2\), and \(Z_3\) are independent random variables with standard normal distributions. The magnitude \(R = \sqrt{Z_1^2 + Z_2^2 + Z_3^2}\) of the vector \((Z_1, Z_2, Z_3)\) has the standard Maxwell distribution.

So in the context of the definition, \( (Z_1, Z_2, Z_3) \) has the standard trivariate normal distribution. The Maxwell distribution is a continuous distribution on \( [0, \infty) \).

### Distribution Functions

In this discussion, we assume that \( R \) has the standard Maxwell distribution. The distribution function of \( R \) can be expressed in terms of the standard normal distribution function \( \Phi \). Recall that \( \Phi \) occurs so frequently that it is considered a special function in mathematics.

\(R\) has distribution function \(G\) given by \[G(x) = 2 \Phi(x) - \sqrt{\frac{2}{\pi}} x e^{-x^2/2} - 1, \quad x \in [0, \infty)\]

## Proof

\((Z_1, Z_2, Z_3)\) has joint PDF \((z_1, z_2, z_3) \mapsto \frac{1}{(2 \pi)^{3/2}} e^{-(z_1^2 + z_2^2 + z_3^2)/2}\) on \(\R^3\). Hence \[\P(R \le x) = \int_{B_x} \frac{1}{(2 \pi)^{3/2}} e^{-(z_1^2 + z_2^2 + z_3^2)/2} d(z_1, z_2, z_3), \quad x \in [0, \infty)\] where \(B_x = \left\{(z_1, z_2. z_3) \in \R^3: z_1^2 + z_2^2 + z_3^2 \le x^2\right\}\), the spherical region of radius \( x \) centered at the origin. Convert to spherical coordinates with \(z_1 = \rho \sin \phi \cos \theta\), \(z_2 = \rho \sin \phi \sin \theta\), \(z_3 = \rho \cos \phi\) to get \[\P(R \le x) = \int_0^\pi \int_0^{2 \pi} \int_0^x \frac{1}{(2 \pi)^{3/2}} e^{-\rho^2/2} \rho^2 \sin \phi \, d \rho \, d \theta \, d\phi, \quad x \in [0, \infty)\] The result now follows by simple integration.

\(R\) has probability density function \(g\) given by \[g(x) = \sqrt{\frac{2}{\pi}} x^2 e^{-x^2 / 2}, \quad x \in [0, \infty)\]

- \(g\) increases and then decreases with mode at \(x = \sqrt{2}\).
- \(g\) is concave upward, then downward, then upward again, with inflection points at \(x_1 = \sqrt{(5 - \sqrt{17})/2} \approx 0.6622\) and \(x_2 = \sqrt{(5 + \sqrt{17})/2} \approx 2.1358\)

## Proof

The formula for the PDF follows immediately from the distribution function since \(g(x) = G^\prime(x)\).

- \(g^\prime(x) = \sqrt{2 / \pi} x e^{-x^2 / 2}(2 - x^2)\)
- \(g^{\prime\prime}(x) = \sqrt{2 / \pi} e^{-x^2/2}(x^4 - 5 x^2 + 2)\)

Open the Special Distribution Simulator and select the Maxwell distribution. Keep the default parameter value and note the shape of the probability density function. Run the simulation 1000 times and compare the emprical density function to the probability density function.

The quantile function has no simple closed-form expression.

Open the Special Distribution Calculator and select the Maxwell distribution. Keep the default parameter value. Find approximate values of the median and the first and third quartiles.

### Moments

Suppose again that \( R \) has the standard Maxwell distribution. The moment generating function of \( R \), like the distribution function, can be expressed in terms of the standard normal distribution function \( \Phi \).

\(R\) has moment generating function \(m\) given by \[ m(t) = \E\left(e^{tR}\right) = \sqrt{\frac{2}{\pi}} t + 2(1 + t^2) e^{t^2/2} \Phi(t), \quad t \in \R \]

## Proof

Completing the square in \(x\) gives \[ m(t) = \int_0^\infty \sqrt{\frac{2}{\pi}} x^2 e^{-x^2/2} e^{tx} dx = \sqrt{\frac{2}{\pi}} e^{t^2/2} \int_0^\infty x^2 e^{-(x - t)^2/2} dx\] The substitution \(z = x - t\) gives \[ m(t) = \sqrt{\frac{2}{\pi}} e^{t^2/2} \int_{-t}^\infty (z + t)^2 e^{-z^2/2} dz = \sqrt{\frac{2}{\pi}} e^{t^2/2} \int_{-t}^\infty (z^2 + 2 t z + t^2) e^{-z^2/2} dz\] Integrating by parts or by simple substitution, using the fact that \(z \mapsto \frac{1}{\sqrt{2 \pi}} e^{-z^2/2} \) is the standard normal PDF, and that \(1 - \Phi(-t) = \Phi(t) \) we have \begin{align} \int_{-t}^\infty z^2 e^{-z^2/2} dz & = -t e^{-t^2/2} + \sqrt{2 \pi} \Phi(t) \\ \int_{-t}^\infty 2 t z e^{-z^2/2} dz & = 2 t e^{-t^2/2} \\ \int_{-t}^\infty t^2 e^{-z^2/2} dz & = t^2 \sqrt{2 \pi} \Phi(t) \end{align} Simplifying gives the result.

The mean and variance of \( R \) can be found from the moment generating function, but direct computations are also easy.

The mean and variance of \(R\) are

- \( \E(R) = 2 \sqrt{2 / \pi} \)
- \( \var(R) = 3 - 8/\pi \)

## Proof

The integration methods are by parts and by simple substitution. \[ \E(R) = \int_0^\infty \sqrt{\frac{2}{\pi}} x^3 e^{-x^2/2} dx = 2 \sqrt{\frac{2}{\pi}} \int_0^\infty x e^{-x^2/2} dx = 2 \sqrt{\frac{2}{\pi}} \] \[ \E\left(R^2\right) = \int_0^\infty \sqrt{\frac{2}{\pi}} x^4 e^{-x^2/2} dx = 3 \int_0^\infty \sqrt{\frac{2}{\pi}} x^2 e^{-x^2/2} dx = 3 \]

Numerically, \( \E(R) \approx 1.5958 \) and \( \sd(R) = \approx 0.6734 \)

Open the Special Distribution Simulator and select the Maxwell distribution. Keep the default parameter value. Note the size and location of the mean\(\pm\)standard deviation bar. Run the simulation 1000 times and compare the empirical mean and standard deviation to the true mean and standard deviation.

The general moments of \(R\) can be expressed in terms of the gamma function \(\Gamma\)

For \(n \in \N_+\), \[ \E(R^n) = \frac{2^{n/2 + 1}}{\sqrt{\pi}} \Gamma\left(\frac{n + 3}{2}\right)\]

## Proof

The substitution \(u = x^2/2\) gives \[\E(R^n) = \int_0^\infty \sqrt{\frac{2}{\pi}} x^{n + 1} x e^{-x^2/2} dx = \int_0^\infty \sqrt{\frac{2}{\pi}} (2 u)^{(n+1)/2} e^{-u} du = \frac{2^{n/2 + 1}}{\sqrt{\pi}} \int_0^\infty u^{(n+1)/2} e^{-u} du\] The last integral is \(\Gamma[(n+3)/2]\) by definition.

Of course, the formula for the general moments gives an alternate derivation for the mean and variance above since \(\Gamma(2) = 1\) and \(\Gamma(5/2) = 3 \sqrt{\pi} / 4\). On the other hand, the moment generating function can be also be used to derive the formula for the general moments. Finally, we give the skewness and kurtosis of \(R\).

The skewness and kurtosis of \(R\) are

- \(\skw(R) = 2 \sqrt{2}(16 - 5 \pi) \big/ (3 \pi - 8)^{3/2} \approx 0.4857\)
- \(\kur(R) = (15 \pi^2 +16 \pi -192) \big/ (3 \pi - 8)^2 \approx 3.1082\)

## Proof

These results follow from the standard formulas for the skewness and kurtosis in terms of the moments, since \(\E(R) = 2 \sqrt{2 / \pi}\), \(\E\left(R^2\right) = 3\), \(\E\left(R^3\right) = 8 \sqrt{2/\pi}\), and \(\E\left(R^4\right) = 15\).

### Related Distributions

The fundamental connection between the standard Maxwell distribution and the standard normal distribution is given in the very definition of the standard Maxwell, as the distribution of the magnitude of a vector in \(\R^3\) with independent, standard normal coordinates.

Connections to the chi-square distribution.

- If \(R\) has the standard Maxwell distribution then \(R^2\) has the chi-square distribution with 3 degrees of freedom.
- If \(V\) has the chi-square distribution with 3 degrees of freedom then \(\sqrt{V}\) has the standard Maxwell distribution.

## Proof

This follows directly from the definition of the standard Maxwell variable \(R = \sqrt{Z_1^2 + Z_2^2 + Z_3^2}\), where \(Z_1\), \(Z_2\), and \(Z_3\) are independent standard normal variables.

Equivalently, the Maxwell distribution is simply the chi distribution with 3 degrees of freedom.

## The General Maxwell Distribution

### Definition

The standard Maxwell distribution is generalized by adding a scale parameter.

If \(R\) has the standard Maxwell distribution and \(b \in (0, \infty)\) then \(X = b R\) has the Maxwell distribution with scale parameter \(b\).

Equivalently, the Maxwell distribution is the distribution of the magnitude of a three-dimensional vector whose components have independent, identically distributed, mean 0 normal variables.

If \(U_1\), \( U_2 \) and \(U_3\) are independent normal variables with mean 0 and standard deviation \(\sigma \in (0, \infty) \) then \(X = \sqrt{U_1^2 + U_2^2 + U_3^2}\) has the Maxwell distribution with scale parameter \(\sigma\).

## Proof

We can take \(U_i = \sigma Z_i\) for \( i \in \{1, 2, 3\} \) where \(Z_1\), \( Z_2 \), and \(Z_3\) are independent standard normal variables. Then \(X = \sigma \sqrt{Z_1^2 + Z_2^2 + Z_3^2} = \sigma R\) where \(R\) has the standard Maxwell distribution.

### Distribution Functions

In this section, we assume that \(X\) has the Maxwell distribution with scale parameter \(b \in (0, \infty)\). We can give the distribution function of \(X\) in terms of the standard normal distribution function \(\Phi\).

\(X\) has distribution function \(F\) given by \[F(x) = 2 \Phi\left(\frac{x}{b}\right) - \frac{1}{b}\sqrt{\frac{2}{\pi}} x \exp\left(-\frac{x^2}{2 b^2}\right) - 1, \quad x \in [0, \infty)\]

## Proof

Recall that \(F(x) = G(x / b)\) where \(G\) is the standard Maxwell CDF.

\(X\) has probability density function \(f\) given by \[ f(x) = \frac{1}{b^3}\sqrt{\frac{2}{\pi}} x^2 \exp\left(-\frac{x^2}{2 b^2}\right), \quad x \in [0, \infty) \]

- \(f\) increases and then decreases with mode at \(x = b \sqrt{2}\).
- \(f\) is concave upward, then downward, then upward again, with inflection points at \(x = b \sqrt{(5 \pm \sqrt{17})/2}\).

## Proof

Recall that \(f(x) = \frac{1}{b} g\left(\frac{x}{b}\right)\) where \(g\) is the standard Maxwell PDF.

Open the Special Distribution Simulator and select the Maxwell distribution. Vary the scale parameter and note the shape and location of the probability density function. For various values of the scale parameter, run the simulation 1000 times and compare the emprical density function to the probability density function.

Again, the quantile function does not hava a simple, closed-form expression.

Open the Special Distribution Calculator and select the Maxwell distribution. For various values of the scale parameter, compute the median and the first and third quartiles.

### Moments

Again, we assume that \(X\) has the Maxwell distribution with scale parameter \(b \in (0, \infty)\). As before, the moment generating function of \(X\) can be written in terms of the standard normal distribution function \(\Phi\).

\(X\) has moment generating function \(M\) given by \[ M(t) = \E\left(e^{t X}\right) = \sqrt{\frac{2}{\pi}} b t + 2(1 + b^2 t^2) \exp\left(\frac{b^2 t^2}{2}\right) \Phi(b t), \quad t \in \R \]

## Proof

Recall that \(M(t) = m(b t)\) where \(m\) is the standard Maxwell MGF.

The mean and variance of \(X\) are

- \( \E(X) = b 2 \sqrt{2 / \pi} \)
- \( \var(X) = b^2 (3 - 8/\pi) \)

## Proof

These result follow from the standard mean and variance and basic properties of expected value and variance.

Open the Special Distribution Simulator and select the Maxwell distribution. Vary the scale parameter and note the size and location of the mean\(\pm\)standard deviation bar. For various values of the scale parameter, run the simulation 1000 times compare the empirical mean and standard deviation to the true mean and standard deviation.

As before, the general moments can be expressed in terms of the gamma function \(\Gamma\).

For \(n \in \N\), \[ \E(X^n) = b^n \frac{2^{n/2 + 1}}{\sqrt{\pi}} \Gamma\left(\frac{n + 3}{2}\right)\]

## Proof

This follows from the standard moments and basic properties of expected value.

Finally, the skewness and kurtosis are unchanged.

The skewness and kurtosis of \(X\) are

- \(\skw(X) = 2 \sqrt{2}(16 - 5 \pi) \big/ (3 \pi - 8)^{3/2} \approx 0.4857\)
- \(\kur(X) = (15 \pi^2 +16 \pi -192) \big/ (3 \pi - 8)^2 \approx 3.1082\)

## Proof

Recall that skewness and kurtosis are defined in terms of the standard score, and hence are unchanged by a scale transformation. Thus the results follow from the standard skewness and kurtosis.

### Related Distributions

The fundamental connection between the Maxwell distribution and the normal distribution is given in the definition, and of course, is the primary reason that the Maxwell distribution is *special* in the first place.

By construction, the Maxwell distribution is a scale family, and so is closed under scale transformations.

If \(X\) has the Maxwell distribution with scale parameter \(b \in (0, \infty)\) and if \(c \in (0, \infty)\) then \(c X\) has the Maxwell distribution with scale parameter \(b c\).

## Proof

By definition, we can assume that \( X = b R \) where \( R \) has the standard Maxwell distribution. Hence \( c X = (c b) R \) has the Maxwell distribution with scale parameter \( b c \).

The Maxwell distribution is a generalized exponential distribution.

If \(X\) has the Maxwell distribution with scale parameter \(b \in (0, \infty)\) then \(X\) is a one-parameter exponential family with natural parameter \(-1/b^2\) and natural statistic \(X^2 / 2\).

## Proof

This follows directly from the definition of the general exponential distribution. and the form of the PDF.