# How would the density of a sphere of uniform composition vary with depth due to gravity?

Let's say we have a planet-sized sphere of some uniform material floating isolated in space, not rotating, with the only significant gravity acting on it coming from its own mass. How would the density vary with depth? Would it be linear, quadratic, cubic, or something else?

For example, say the sphere is composed of iron, with a density at the surface of 7874 kg/m$$^3$$, and a total mass equivalent to the Earth at 5.972 × 10$$^{24}$$ kg. How dense would it be, say, at the core, or halfway between the core and the surface? If density were constant such a sphere would have a radius of approximately 5657 km, instead of Earth's own 6357-6371, but due to gravity we would expect the outer mass of the sphere to contract and compress the inner material. I want to know how this gravitational compression affects the density.

• If the composition is uniform then the density is also uniform. Iron doesn't get compressed. Aug 4, 2021 at 20:35
• @Pete under the extreme pressure created by the gravity of a sphere more than 10,000 km in diameter, iron does compress. The density of Earth's core is estimated at 13,100 kg/m³. Iron and nickel, which make up the majority of Earth's core, only have densities at the surface of 7,874 kg/m³ and 8,900 kg/m³ respectively, so their density must increase inside the Earth's core. Aug 4, 2021 at 20:42
• I stand corrected. That's a lot of pressure! Aug 5, 2021 at 21:46