Atmospheric pressure as a function of altitude Consider a planet with a thin atmosphere. The planet is assumed to have radius $r_0$ and mass M.
The gravitational field outside the planet is given by: $$\vec g = - \frac {GM} {r^2} \vec e_r$$ where G is Newton's gravitational constant. The atmosphere near the surface of the planet can be considered as a stationary linearly compressible fluid, which means that a relationship $ρ = ρ_0 + α(p - p_0)$ applies between the density of the fluid $ρ$ and the pressure $p$. Here $ρ_0$ and $p_0$ are the density of the atmosphere respective pressure at the planetary surface.
i) Set up a differential equation that describes how the pressure $p$ varies with the distance r from the center of the planet. Hint: You can base your reasoning on static equilibrium and Archimedes' principle.
ii)Calculate how the atmospheric pressure p and the density of the atmosphere $ρ$ depend on r.
Assume that pressure and density only depend on r.
I am not quite sure how to start on i) since equilibrium in the radial direction is given by $-m\frac {GM} {r^2} + ρVg = 0$ and $ρV = m$ the previous expression is just zero and that doesn't give me anything
Thanks in advance!
 A: Imagine a box of small height hanging in the air. The basis of the box has area A and height dr. The pressure at the bottom of the box is $p$. The pressure at the top of the box is $p+dp$. Consider the equilibrium of the box. You have force $pA$ pushing box upwards and force $(p+dp)A$ pushing box downwards. You have also the weight of the air in the box which is $\rho g Adr$ (product of mass contained in the box and acceleration of gravity). Equation of equilibrium is:
$$pA-\rho g A dr-(p+dp)A=0$$
$$dp=-\rho g dr=-(\rho_0+\alpha (p-p_0))\frac {GM}{r^2}dr$$
$$\frac{dp}{\rho_0+\alpha (p-p_0)}=-\frac {GM}{r^2}dr$$
$$\int_{p_0}^p\frac{dp}{\rho_0+\alpha (p-p_0)}=\int_{r_0}^r-\frac {GM}{r^2}dr$$
$$\frac{1}{\alpha}\ln[\rho_0+\alpha(p-p_0)]|_{p_0}^p=\frac{GM}r|_{r_0}^r$$
$$\frac{1}{\alpha}\ln[\rho_0+\alpha(p-p_0)]-\frac{1}{\alpha}\ln\rho_0=GM(\frac 1r - \frac 1{r_0})$$
$$\ln[1+\frac{\alpha(p-p_0)}{\rho_0}]=\alpha GM(\frac 1r - \frac 1{r_0})$$
$$\frac{\alpha(p-p_0)}{\rho_0}=e^{\alpha GM(\frac 1r - \frac 1{r_0})}-1$$
$$p=\frac{\rho_0}{\alpha}[e^{\alpha GM(\frac 1r - \frac 1{r_0})}-1]+p_0$$
$$p(r)=p_0-\frac{\rho_0}{\alpha}[1-e^{-\alpha GM(\frac 1{r_0}-\frac 1r)}]$$
In reality, atmosphere of Earth is modelled a little bit differently. Starting point is temperature of air as a function of height, equation which is made empirically from measurements, not relation between pressure and density of air. But as you said, this is a problem from mathematics and it has very little to do with some real physics of atmosphere.
