system
Given the following post, respond as if you're commenting on Reddit:
human
Why are planets treated as if they have all of their mass at the center?

I've read why g is constant, partly because r in the law of universal gravitation is constant, and I think I remember it is constant because you use the radius from the earth's center. I was wondering, why is it true that you think of all of their mass being at the center?
gpt
It's a mathematical consequence of Gauss's Law. If the planet is assumed perfectly spherical (i.e., has a mass density that depends only on the distance from the center), then the gravitational field is entirely radial. That is, the gravitational field always points in a radial direction (either inward or outward) and depends only on the distance from the center of the mass.

The field strength at some distance *r* is dependent only on the mass enclosed by a sphere of radius *r* with the same center as the mass. So for a perfectly spherical mass, the gravitational field *outside* the mass behaves as if it were the field of a point particle with the same mass, but located at the center of the planet.

The field *inside* the planet is not simply the field of a point particle, and depends crucially on the interior radial density. For instance, if the planet has some hollow core (possibly the entire planet is just a hollow shell), then the field is 0 inside the hollow core. If the planet has a uniform density, then the field inside points radially outward and the field strength grows linearly from 0 at the center to its max value at the surface.