For a thin spherical shell, outward pressure force is −4πr2(dP/dr)dr and inward weight is GM(r)ρ(4πr2dr)/r2. Balance gives dP/dr=−GM(r)ρ/r2. This assumes approximately spherical, slowly evolving structure without important rotational or magnetic support.