From a sphere of mass M and radius R, a smaller sphere of radius is carved out such that the cavity made in the original sphere is between its centre and the periphery (see the figure). For the configuration in the figure where the distance between the centre of the original sphere and the removed sphere is 3R, the gravitational force between the two spheres is:

The mass of the removed sphere () is
Center of the Original Sphere ():
Center of the Cavity (): Since the cavity is carved between the center and periphery, its center is at .
Center of the External removed sphere (): The distance between the center of the original sphere and the removed sphere is . Its position is .
Distance from to () = . Distance from to () =
Tagged Kepler's laws and planetary motion. Machine-assigned, so read it as a strong shortlist rather than a verdict.