Given any distribution of mass, the gravity at any point outside it can be calculated by dividing the mass into infinitesimal masses, and adding up the gravity due to each. Doing that, I faced a problem on the surface of an object: no matter how small you make the integration step, near the point of interest the distance to the infinitesimal mass gets smaller than the integration step so you get very wrong values. So what is the proper way to integrate gravity for a point at the surface of an object? Maybe there is a theorem that a hemisphere has this much gravity at its centre, sso you can use the result for infinitesimal masses closer than D from the point of interest on the surface. Can anyone solve this integral analytically? Total gravity at centre = ?