average speed of gas particles is \(v_{rms}\) or take avergae of the squares of each particle velocity and then take the square root at end. Or\[ \bar {v}=\sqrt {\frac {3RT}{m}}\] Where \(R\) is the gas constant, \(T\) is gas absolute temperature and \(m\) is molar mass of each gas particle in kg/mol.
\(dn\)\[ dn=f\relax (v) dv_{x}dv_{y}dv_{z}\] Where \(dn\) is the number denity of gas particles (how many particles per unit volume with velocity between \(v\) and \(v+dv\))
Average speed of particles\begin {align*} \bar {v} & =\frac {\int vdn}{\int dn}\\ & =\frac {\int \int \int vf\relax (v) dv_{x}dv_{y}dv_{z}}{n}\\ & =\frac {1}{n}\int _{-\infty }^{\infty }\int _{-\infty }^{\infty }\int _{-\infty }^{\infty }vf\relax (v) dv_{x}dv_{y}dv_{z}\\ & =\frac {1}{n}\int _{\phi =0}^{2\pi }\int _{\theta =0}^{\pi }\int _{v=0}^{\infty }vf\relax (v) \left (v^{2}\sin \theta \right ) dvd\theta d\phi \\ & =\frac {1}{n}\int _{\phi =0}^{2\pi }d\phi \int _{\theta =0}^{\pi }\sin \theta d\theta \int _{v=0}^{\infty }f\relax (v) v^{3}dv\\ & =\frac {1}{n}\left (2\pi \right ) \left (-\cos \theta \right ) _{0}^{\pi }\int _{v=0}^{\infty }f\relax (v) v^{3}dv\\ & =-\frac {1}{n}\left (2\pi \right ) \left (-1-1\right ) \int _{v=0}^{\infty }f\relax (v) v^{3}dv\\ & =\frac {4\pi }{n}\int _{v=0}^{\infty }f\relax (v) v^{3}dv \end {align*}
Pressure\begin {align*} dF & =F_{1}dN\\ & =\left (\frac {2mv_{z}}{\Delta t}\right ) dn\Delta Av_{z}\Delta t\\ & =2mv_{z}^{2}dn\Delta A \end {align*}
Hence\begin {align*} P & =\frac {\int dF}{\Delta A}\\ & =2m\int v_{z}^{2}dn\\ & =2m\int dv_{x}\int dv_{y}\int f\relax (v) v_{z}^{2}dv_{z} \end {align*}
This integral can be evaluated in spherical coordinates.
net energy density of gas\begin {align*} E & =\int \frac {1}{2}mv^{2}dn\\ & =\frac {1}{2}m\int \int \int v^{2}dn\\ & =\frac {1}{2}m\int \int \int \left (v_{x}^{2}+v_{y}^{2}+v_{z}^{2}\right ) dn\\ & =\frac {3}{2}m\int \int \int v_{z}^{2}dn\\ & =\frac {3}{2}m\int _{-\infty }^{\infty }dv_{x}\int _{-\infty }^{\infty }dv_{y}\int _{-\infty }^{\infty }v_{z}^{2}f\relax (v) dv_{z}\\ & =3m\int _{-\infty }^{\infty }dv_{x}\int _{-\infty }^{\infty }dv_{y}\int _{0}^{\infty }v_{z}^{2}f\relax (v) dv_{z} \end {align*}
Hence\[ P=\frac {2}{3}E \] And \(E=\frac {3}{2}nKT\rightarrow P=nKT\) for ideal gas.