Barometric formula / Hydrostatic pressure for an ideal gas I have recently looked into two different derivations of the Barometric formula, trying to figure out why both of them work: (assuming temperature is constant for all heights)

*

*One is based on the hydrostatic principle $\frac{\mathrm{d}p}{\mathrm{d}h}=-\rho(h)g$, i.e. the pressure of the gas is given by the weight of the gas above. Solving this differential equation, one ends up with an exponential dependence, and using the ideal gas law, one arrives at the Barometric formula. A bit more explicit:
We know that the pressure is given by the pressure of all the air above us, or put differently, the pressure increase per height is given by the additional weight of air at that height:
$$\frac{\mathrm{d}p}{\mathrm{d}h}=-\rho(h)g$$
Inserting the ideal gas law $\frac NV=\frac p{k_{\mathrm{B}}T}$ and $\rho=\frac{Nm}V$ (where $m$ is the mass of air particles) we get
$$\frac{\mathrm{d}p}{\mathrm{d}h}=-\frac{N(h)mg}V=-\frac{p(h)mg}{k_{\mathrm{B}}T}$$
Solving for $\rho(h)$ we get
$$p(h)=p_0\exp\left(-\frac {mg}{k_{\mathrm{B}}T}h\right)$$


*The second derivation is based on statistical mechanics: We know that the number density of molecules follows Maxwell-Boltzmann Statistics, i.e. $n\propto\exp\left(\frac{mgh}{k_{\mathrm{B}}T}\right)$. Using the ideal gas law and the fact that temperature is constant, we can see that the pressure is once again following an exponential. A bit more explicit: We expect the distribution of particles into the different energy states to follow Maxwell-Botzmann Statistics, i.e. $N(E)\propto\exp\left(-\frac E{k_{\mathrm{B}}T}\right)$ (assuming no/constant degeneracy). The energy of the different states in our case is given by the potential energy of the particles: $E_{\mathrm{pot}}=mgh$. Thus
$$N(h)\propto\exp\left(-\frac{mg}{k_{\mathrm{B}}T}h\right)$$
Using the ideal gas law $N=\frac{pV}{k_{\mathrm{B}}T}$ we finally get
$$\frac{p(h)V}{k_{\mathrm{B}}T}\propto\exp\left(-\frac{mg}{k_{\mathrm{B}}T}h\right)$$
$$\Rightarrow p(h)=p_0\exp\left(-\frac{mg}{k_{\mathrm{B}}T}h\right)$$
The issue is now that I don't see the connection between the two: Both approaches seem to work fine and are frequently used to derive the Barometric formula. However, the first one looks at all the gas "pressing down" on a given volume, whereas the second one does not assume any interaction between the individual air particles.
What I've been able to see so far is only that we implicitly use Maxwell-Boltzmann statistics in the first derivation via the ideal gas law, but the use of the hydrostatic principle seems to have no analogue in the second derivation. As such, this is the part I'm most suspicious about: What assumptions do I have to make to apply the formula for hydrostatic pressure (All derivations I could find so far seem rather hand-wavy, so I'm not sure on the specifics here)? Can I apply it to an ideal gas?
TL;DR
To summarize: What are the analogous parts of the two derivations of the Barometric formula above? Why do both work? Where do I invoke the equivalent of hydrostatic pressure in the second one? Is the issue somewhere else, maybe in the assumption of constant temperature?
 A: Firstly, it is not true that interactions are not accounted for in statistical mechanics: they are not explicitly included in the equations, but they are responsible in establishment of thermodynamic equilibrium, and the thermodynamic reasoning that leads to Boltzmann distribution relies on their existence.
Another way to look at it is that the first derivation is based on calculating macroscopic forces for average air density and mass, whereas the statistical physics approach first accounts for the forces acting on each molecule and only then performs the averaging (Boltzmann distribution includes multiparticle Hamiltonian, which accounts for all the forces).
However, there are finer points regarding the transition from statistical physics description to the hydrostatic one (which is another way to describe the first approach): since the statistical equilibrium is established via collisions, one cannot derive the hydrostatic (or more general hydrodynamic) equations from those of equilibrium statistical physics, but needs to work with Boltzmann equation (or more generally with BBGKY hierarchy). See for related discussions:

*

*How does hot air rise?

*What is (local) pressure within a gas on the microscopic level?

*Could Navier-Stokes equation be derived directly from Boltzmann equation?
A: Thanks for filling out the derivations! It's much clearer what you're asking about now.
Both derivations rely on the premise that (at least at constant temperature in an ideal static fluid) it takes energy for a particle to move upward in a gravitational field and that this energy is mediated solely by the particle's mass, gravitational acceleration, and height increase.
To this we can add the premise that Nature prefers low-energy scenarios but also high-entropy scenarios. Energy-lowering  scenarios heat the rest of the universe and increase its entropy. In both cases, the higher entropy is associated with more possibilities and therefore a greater likelihood of occurrence.

*

*Let's start with the Maxwell–Boltzmann relation of your second derivation. The math of statistical mechanics tells us that this relation (an exponential or Arrhenius relation that contains an energy barrier divided by the thermal energy $kT$) gives us the best tradeoff between system energy minimization and entropy maximization. One way to interpret this is that the energy to gain altitude can come from the thermal energy of the system itself. (As we cool toward 0 K, we should expect perfect stratification of gases, for example.) Inserting the equation of state for the material of interest (here, the ideal gas law), we obtain an exponential dependence of pressure on height, with the temperature also making an appearance.


*For the hydrostatic equation used in your first derivation, we must realize that (1) a force in a certain direction simply means that the energy increases per unit displacement in the opposite direction; forces are spatial derivatives of energy. (2) The density of a certain material at a certain temperature and pressure already captures the interplay between energy and entropy (e.g., high-entropy gases have lower density than low-entropy liquids). From these two points, we should expect the gas at higher altitudes to tend to move downward and therefore to apply a weight at lower altitudes, which is distributed uniformly in the form of pressure because ideal fluids can't sustain a shear stress. With the energy and entropy aspects already taken care of and the existing relationship between energy and force, it's no surprise that this derivation produces the same prediction as the other one while also providing a nice check of the consistency of the principles.
So why does weight appear in the first but not the second derivation? Because the stiffness of an ideal gas is entirely entropic. It has to be, because we presume no enthalpic interactions. Consider a thought experiment in which we remove the top half of a region of gas; the particles in the lower half would shift somewhat into the upper half. We can interpret this as either a rebounding effect from the removal of a weight or the spontaneous tendency of the remaining particles to increase their entropy by exploring the available space. In the first interpretation, we incorporate the bulk density; in the second, the microscale particle statistics. A similar dichotomy applies to your two derivations.
