# Hydrostatic equilibrium of a star derivation

I've been told to revise the derivation that proves $\frac{\mathrm{d}P}{\mathrm{d}r} =\frac{GM(r)p(r)}{r^2}$ where brackets indicate a function of, P is pressure and p is density. Rather helpfully he hasn't given us it to revise, so if anyone knows it I'd be really grateful. Thanks.

-
I think you've mistaken $P\$ for $\rho$.
Here's why: Since we're looking for a static solution, the gravitational force balances exactly the pressure gradient: $$\vec\nabla P +\vec f=0$$ where $\vec f$ is the gravitational force density. Since the system is spherically symmetric, you can write $\vec \nabla P=\frac{dP}{dr}\hat r$, and use $\vec f=-\rho(r) \frac{G M(r)}{r^2}\hat r$ to get $$\frac{dP}{dr}= \frac{G M(r)\rho(r)}{r^2}$$
Now in order to solve this you need to have some constitutive relation $\rho=\rho(P)$, but that is probably what your teacher is going to do in class...