I'm trying to perform a physics problem, however, my issue is with the math. I want to sum each bit of contributing pressure felt at the base of a static gas column as additional "parcels of gas" are added to the top of the column.
I am working with the barometric formula, where the density of ideal gas varies with elevation following this relation: $$\tag{1} \rho (z) = \rho_o \cdot \exp\left(-\frac{Mg}{RT} dz\right)$$
The pressure at the base of a static gas column can be calculated using this relation: $$\tag{2} p=\rho gz$$
So, I think that the change in pressure with each incremental change in height of the gas column can be written mathematically as $$\tag{3} dp=\rho (z)gdz$$
which can then be integrated, I believe as so $$\tag{4} \int_{p_o}^p dp = g \int_{z_o}^z \rho (z) dz$$
$$\tag{5} p_z - p_o = g \int_{z_o}^z \rho_o \cdot e^{(-\frac{Mg}{RT}\ dz)}\ dz$$
I'm not sure if everything I have here is correct, but I do know that I am stumped on how to handle the integral on the rhs of eqn 5. The variables on the rhs of eqn 5: $\rho_o, M, g, R, T$ are all constants.