Let be the core radius and the planetary radius. For the two-layer constant-density planet,
and the mantle volume gives
The enclosed mass profile is