where G is the gravitational constant, and the two masses in this case are that of the thin shells of width dr, and the contained mass within radius r as one integrates between zero and the radius of the total sphere. This gives: