We did a simple example in lecture with sea pressure but for this question I'm kinda confused. It goes like this:
We can model the atmosphere as a $\textbf{static fluid}$, with the air a $\textbf{compressible perfect gas}$ acting under a uniform gravitational field in the negative $z$-direction $\underline{g} = -g\underline{\hat{k}}$. That the pressure $p$ satisfies $$\frac{\mathrm{d}p}{\mathrm{d}z} = -\rho g \quad \text{with}\quad p=\rho\mathcal{R}T$$ where $T$ is the tempertature and $\mathcal{R}$ is the gas constant, subject to $$p=p_0,\quad T=T_0,\quad \text{at}\quad z=0$$ Find the solution $p=p(z)$ if we assume
(i) The temperature varies linearly with height $z$, $T(z) = T_0 - \beta(z-z_0)$
(ii) The temperature is isothermal $T = T_0$
I am very new to this so I'm not sure how to use the information I'm given to solve for $p(z)$. I am not even sure of how to think of the situation in a image. Can I have some guidence on how a question like this is to be undertaken?
I think to find $p(z)$ I have to integrate to get
$$p(z) = p_0 - \rho gz = \rho\mathcal{R}T - \rho gz\quad??$$
And do I then use what I am given for $T(z)$ to get
$$p(z) = \rho\mathcal{R}\Big(T(z) + \beta(z - z_0)\Big) - \rho gz$$
But what would I do now?
Given $$\frac{dP}{dz} = -\rho g \quad \text{with}\quad P=\rho RT\implies \frac{dP}{dz} =-\frac{g}{RT}P$$ So, if you are given that $$T = T_0 - \beta(z-z_0)$$ you face the differential equation $$\frac{dP}{dz} =-\frac{g}{R(T_0 - \beta(z-z_0))}P\tag 1$$ which is separable.
Just go ahead.
Edit
After comments, using $(1)$, we get $$\log(P)=\frac{g }{\beta R}\log (R T_0-\beta R(z -z_0))+C\tag 2$$ and the initial condition write $$\log(P_0)=\frac{g }{\beta R}\log (R T_0)+C \tag 3$$ Subtract $(3)$ from $(2)$ to get $$\log \left(\frac{P}{P_0}\right)=\frac{g }{\beta R} \log \left(1-\frac{\beta (z-z_0)}{T_0}\right) \tag 4$$ Now, take exponentials of both sides.
For the limiting case (isothermal) corresponding to $\beta=0$, using $(1)$ makes the problem very simple.