I have tried multiple sources and methods, but my attempts at a proof of the number of particles leaving a gas using statistical mechanics keep finding the same wrong result. I have tried to read other answers on this site but none of them had exactly what I wanted or just jumped to conclusions.
Let $Φ$ be the number of particles per unit of time and area leaving a box of gas by means of a small hole.
We know from the kinetic theory of gases that the average $Vx$ (modulus of velocity in the x direction) is $<Vx> = <Vel>/4$, where $Vel$ is the velocity of particles.
Let us calculate the number of particles with x-direction velocity equal to $Vx$ that escapes through the hole of area $S$ during time $dt$. The particles come from a cylinder of height $Vx.dt$ and area of the base $S$. So the particles come from the region of volume $S.Vx.dt$.
If the gas has a number $n(Vx)$ of particles with x-velocity equal to $Vx$ per unit of volume, then from the cylinder will come, in time $dt$, a number $Nxc = n(Vx).S.Vx.dt$ of particles.
If we sum all the $Nxc$ for different x-velocities we find the number $Nc$ of particles that escaped. Then
$Nc = S.dt.ΣVx.n(Vx)/2$, where $/2$ appeared because only half of the particles have $Vx > 0$, i.e., are going in the direction of the hole.
If the gas has a total volume $V$, we can call $n(Vx) = N(Vx).V$ where $N(Vx)$ is the total number of particles with velocity $Vx$ in the whole gas. Then:
$$2Nc = S.dt.ΣN(Vx).Vx/V$$
We multiply the right side by $N/N$, where $N$ is the total number of particles in the gas:
$2Nc = S.dt.(N/V).[ΣN(Vx).Vx/N]$
Well, $ΣVx.N(Vx)/N$ is just $<Vx>$, right? So:
$$2Nc = S.dt.(N/V).<Vx>$$
But we can write $Nc/(S.dt) = Φ$ and $N/V = n$:
$$2.Φ = n.<Vx>$$
But $<Vx> = <Vel>/4$
$$Φ = n.<Vel>/8 (!!!)$$
This is wrong. It is well known that $Φ = n.<Vel>/4$, not $/8$. I can't seem to find the mistake.
I asked a person and they told be I should've used $<Vx> = <Vel>/2$ in this case for some reason, but I can't see why and this doesn't agree with Maxwell-Boltzmann distribution.
Where is my mistake? I can't seem to find anything, really. Even if I increase the mathematical rigor of $<Vx>,<|Vx|>$ etc, I can't find another answer. Where am I wrong?
It appears to me that some sort of double integral is used to find the apparent result of $<Vx>= <Vel>/2$ (?). I cannot, however, understand double integrals: only simple integration.
Anyway, I have tried multiple sources but most proofs seem to jump some or the steps I did. Where is my mistake and how can I solve it?