Why does the mean speed of gas particles include $\pi$? In chemistry we are learning about kinetic molecular theory (KMT) of gasses, and I just couldn't help being surprised when I saw $\pi$ in the equation of mean speed. I know that whenever $\pi$ is involved in an equation, it somehow involves circles, but KMT assumes that the molecules are points. The mean speed is $\sqrt{(8RT)/(\pi\,M)}$, where $R$ is the universal gas constant (8.3144 J/K mol), $T$ stands for the temperature in kelvins, and $M$ is the molar mass of the molecule.
It just fascinates me that $\pi$ is everywhere, especially here and I would like to know why.
 A: This can be obtained from the Maxwell Distribution for the speeds of a molecule in an ideal gas
$$P(v)=\left(\frac{m}{2\pi kT}\right)^{3/2}4\pi v^2e^{-mv^2/2kT}$$
where $m$ is the mass of the molecules, $k$ is Boltzmann's constant, $T$ is the temperature, and $v$ is the speed. $P(v)\,\text dv$ tells us the probability of observing a molecule with a speed between $v$ and $v+\text dv$


*

*The $e^{-mv^2/2kT}$ term is just the Boltzmann factor that tells us
the probability of observing a molecule with speed $v$ (or
technically energy of $\frac12mv^2$).

*The $4\pi v^2$ factor can be thought of as the the number of velocity
vectors $\mathbf v$ with a speed $v$. The idea is that you can think
of the set of these vectors as lying on a "sphere", so the number
will be proportional to the surface area of this "sphere". (Technically the important part here is the $v^2$, and the $4\pi$ could be left out and then brought back upon normalization, but I think an interpretation like this is the main thing you are looking for here).

*The $\left(\frac{m}{2\pi kT}\right)^{3/2}$ is just a constant term so
that the entire distribution integrates to $1$, i.e. there is a
probability of $1$ of observing any speed. A different view of this normalization constant can be found in Ezze's answer.


To obtain the expression for the average speed, we find the average through usual means
$$\bar v=\int_0^\infty vP(v)\,\text dv=\sqrt{\frac{8kT}{\pi m}}$$

So where do the $\pi$'s come into play here? Well, we saw it in our velocity "sphere", and therefore it also comes into play in the constant factor. Then we end up with an overall $\pi^{-1/2}$, which carries over into the average speed. Since you were looking for circles, I would say the mostly likely culprit is just from that idea of the velocity "sphere".
A: The reason for the appearance of Pi in the Maxwell-Boltzmann distribution can be rationalized by the following steps:
1) The probability of a given state in a thermal ensemble is proportional to the Boltzmann factor $\exp{(-E/kT)}$. 
2) The energy of the point gas particle is expressed by its momentum $p$, the Boltzmann factor is then $\exp{(-p^2/2mkT)}$. 
So we know that the probability of a molecule having a total momentum of $p$ is proportonal to  $\exp{(-p^2/2mkT)}$. To make a proper distribution $f_p$ that tells you the probablity of a molecule having a momentum between $p$ and $p+\delta p$ we must make sure that the integral of $f_p$ gives 1. That means we got to normalize it by the integral of the Boltzmann factor:
$ \int \int \int_{-\infty}^{\infty} \mathrm{d}p_x \mathrm{d}p_y \mathrm{d}p_z \exp{(-(p_x^2+p_y^2+p_z^2)/2mkT)}  $
Now, know that this integral is the famous Gaussian integral:
$ \int_{-\infty}^{\infty} \exp{(-x^2)} \mathrm{d}x = \sqrt{\pi} $
Which, when applied for the three spatial dimensions, gets you the $\pi ^{-3/2} $ factor that you must have encountered in your lecture somewhere.
Side note: $\pi$ always appears when you are dealing with 3D problems simply because you almost always 'partition' the space into small spheres and you get the volume of the sphere in your results. 
A: This has to do with the probability distribution of the velocities of the molecules. Without knowing the distribution, one can only calculate the rms of the velocity (see e.g. here). Which leads to a different equation without $\pi$:
$v_{rms} = \sqrt{3RT/M}$
If you know the distribution, you can integrate the probability distribution of velocities over the volume (this is where the factor of $\pi$ comes in). You then arrive at the equation stated in your question. See e.g. here.
