I am trying to understand how to derive the following formula:
$\frac{dP(r)}{dr}=-\frac{GM(r_<)\rho(r)}{r^2}$
The notes are as follow:
Consider a star with COM and a shell:
$P_1 - P_2 = -{\large\frac{dP}{dr}}\,dr$
${\large\frac{dP}{dr}} + g\rho = 0$ ( My main issue with the derivation is unsure where this comes from.)
Then if we take $g = {\large\frac{Gm}{r^2}}$ and substitute into the above equation, we get the expected result.
If anyone could explain this derivation to me or an alternative one, it would be much appreciated.