If you need to show this what you need to do is perform a volume integration in spherical coords. Your density is , and the distance to the volume element is . Then you want to evaluate
If we assume this integral is easy and gives the formula above.
I hope this is what you're after.