Consider a self-gravitating, spherically symmetric fluid in hydrostatic equilibrium. Mass is conserved and thus described by the continuity equation d m d r = 4 π π r 2 ρ ρ where ρ ρ is a function of r . The equation of hydrostatic equilibrium is 1 ρ ρ d P d r = − − G m r 2 where m is also a function of r . Differentiating again gives d d r ( 1 ρ ρ d P d r ) = 2 G m r 3 − − G r 2 d m d r = − − 2 ρ ρ r d P d r − − 4 π π G ρ ρ where the continuity equation has been used to replace the mass gradient. Multiplying both sides by r 2 and collecting the derivatives of P on the left, one can write r 2 d d r ( 1 ρ ρ d P d r ) + 2 r ρ ρ d P d r = d d r ( r 2 ρ ρ d P d r ) = − − 4 π π G r 2 ρ ρ