While it's true that Mercury and Venus, the two innermost planets, have higher densities than Earth and Mars, there are a few reasons why this is *not* a universal rule:
* Formation: The planets formed from a disk of gas and dust around the young Sun. The inner part of the disk was hotter and denser, leading to the formation of rocky planets with heavier elements.
* Gravity: The Sun's gravity was stronger closer to the center, which attracted more massive materials during formation.
* Volatiles: Planets further out experienced less heat from the Sun, allowing them to retain more volatile elements like hydrogen and helium, which have low densities.
Exceptions:
* Jupiter and Saturn, the gas giants, have much lower densities than Earth despite being further away from the Sun. This is due to their composition, which is primarily hydrogen and helium, the lightest elements.
* Uranus and Neptune, the ice giants, have densities that fall between the rocky planets and the gas giants, due to their composition of lighter elements like water, methane, and ammonia.
Therefore, the density of a planet is determined by its composition and the conditions under which it formed, not solely by its distance from the Sun.