Differential Equations Pressure and Density derivation The pressure $p$, and the density, $\rho$, of the atmosphere at a height $y$ above the earth's surface are related by $dp = -g \rho\; dy$. Assuming that $p$ and $\rho$ satify the adiabatic equation of state $p = p_0(\rho/\rho_0)^\gamma$, where $\gamma \neq 1$ is a constant and $p_0$ and $\rho_0$ denote the pressure and density at the earth's surface, respectively, show that
$$p = p_0\left[1 - \frac{\gamma - 1}{\gamma} \left(\frac{\rho_0 g y}{p_0}\right)\right]^{(\gamma - 1)/\gamma}$$
~~~~~~~~~~~~~~
My work: 
I separated variables and got $p = -g\rho y + c$. That's as far as I got. 
 A: to make typing easier, i will use $k, r$ for $\gamma$ and $\rho$ respectively. 
we are given $$ dp = -gr dy, \, p = p_0 (r/r_0)^k.$$ we will solve for $r$ first, and then use the second relation to get hold of $p.$
taking logarithm and differentiating the $p$-$r$ relation gives us 
$$ k\frac{dr}r = \frac{dp}{p} = -\frac{gr\,dy}p = -\frac{gr_0^kr\, dy}{p_0r^k} $$ separating the variables $$kr^{k-2} \, dr = -\frac{gr_0^k}{p_0}\, dy $$ and on integration yields $$\frac k{k-1}\left(r/ r_0\right)^{k-1} =  -gy+C$$ setting the initial condition $r =r_0$ at $y= y_0$ gives $$(r/r_0)^{k-1} = \frac{k-1}{k}\left( \frac k{k-1}-gy\right)=1-\frac{k-1}kgy $$
i hope you can complete the rest.
A: You are given two equations:
$$dp = -g \rho\; dy  \tag1$$
and
$$p = p_0(\rho/\rho_0)^\gamma.  \tag2$$
You cannot simply integrate both sides of $(1)$, treating $\rho$ as a constant,
because in fact $\rho$ is less at high altitudes than at low altitudes;
it is not constant.
What you can do is use $(2)$ to eliminate $\rho$ from $(1)$,
leaving you with an equation involving only $p$, $y$, and some constants.
You can then do your separation of variables and integrate.
