In the derivation of the barometric height formula, we have already seen that the ratio of pressure to density is constant. In this formula, we can therefore replace the pressure with the density of the gas:
$$
\varrho = \varrho_0 e^{-\frac{\varrho_0 g h}{p_0}}
$$
If we now multiply the fraction in the exponent by an arbitrary volume \(V\) and then replace the denominator using the ideal gas equation, we obtain:
$$
\varrho = \varrho_0 e^{-\frac{m g h}{N k_B T}}
$$
We already know that the particle number density \(n\) in a given volume is proportional to the density of the gas, i.e.:
$$
n = n_0 e^{-\frac{m g h}{k_B T}}
$$
The numerator can now be interpreted as the potential energy of the gas, \(E = m g h\), which makes sense since we have already seen in the kinetic gas theory that the quantity \(k_B T\) is linked to the energy of a gas. Assuming that all gas layers are in equilibrium, the law of conservation of energy can be applied, allowing the potential energy to be replaced by kinetic energy:
$$
n = n_0 e^{-\frac{E_\mathrm{kin}}{k_B T}}
$$
The exponential term plays an important role in thermodynamics and is called the Boltzmann factor.
If we now want to calculate the probability that a particle has a certain velocity \(v\), the resulting function must be normalized so that the integral under the graph equals 1. Substituting the formula for kinetic energy gives the following probability distribution for a particle in a gas of temperature \(T\):
$$
p(v) = \sqrt{\frac{m}{2\pi k_B T}} e^{-\frac{m v^2}{2 k_B T}}
$$
We immediately recognize this as a symmetric Gaussian distribution around the origin.
This means that the mean value of all velocities is 0, since there is no preferred direction for the gas particles.
In three dimensions, the relation \(v^2 = v_x^2 + v_y^2 + v_z^2\) leads to spherical surfaces, whose probability density is also described by a Gaussian distribution. With this in mind, we now want to calculate the distribution for the magnitude of the velocity, without considering the direction of the particles.
We assume that all particles with speed \(v\) lie on a spherical surface around the origin. To find the probability of finding a particle on this spherical surface, this equation must therefore be multiplied by the surface area \(4 \pi v^2\).
The result is the well-known Maxwell–Boltzmann distribution:
$$
p(v) = \left(\sqrt{\frac{m}{2\pi k_B T}}\right)^3 4\pi v^2 e^{-\frac{m v^2}{2 k_B T}}
$$
The normalization constant must also be cubed in order to yield an integral of 1, which explains the third power of the square root.
If this function is differentiated and the result set to zero, we obtain the maximum of the distribution:
$$
\hat{v} = \sqrt{\frac{2 k_B T}{m}}
$$
This is therefore the most probable speed, but not the mean speed of the gas particles. The latter can be calculated analogously to the arithmetic mean, by summing (integrating) over all possible velocities:
$$
\bar{v} = \int_0^\infty v p(v)\, \mathrm{d}v
$$
Using integration by parts, one obtains for the mean velocity:
$$
\bar{v} = \frac{8 k_B T}{\pi m}
$$
Geometrically, this corresponds to the velocity for which the areas under the graph on both sides of this value are equal.
The Maxwell–Boltzmann distribution strongly depends on the temperature \(T\) and is asymmetric. The theoretically calculated values of the mean velocity \(\bar{v}\) for different temperatures confirm this behavior.