Let R denote the radius of the outer sphere and r the radius of the inner sphere. Let d denote the density of the inner sphere and D the density of the surrounding shell that means what is left from the outer sphere. I assume that only the radius of the inner sphere is variable, all other values are constant. Then the mass of the complete solid is calculated by: