Final answer:
The heating of planets during their formation was primarily due to accretion of planetesimals that generated heat upon impact, contraction of gas in giant planets, and heat from radioactive elements. These processes led to the melting and differentiation of planetary materials.
Step-by-step explanation:
What heated all the planets as they were formed? The heating of the planets during their formation originated from a few key processes. As protoplanets grew, they incorporated planetesimals through the process of accretion. The gravitational pull of the protoplanets caused these planetesimals to accelerate and strike with significant energy, generating heat upon impact. This resulted in the melting of the projectile and a part of the impact area, causing the entire protoplanet to heat up to above the melting temperature of rocks.
For the giant planets, which formed in the outer solar system, the heating was intense due to their larger size. As they attracted and held surrounding gas, mainly hydrogen and helium, they underwent rapid contraction, which released energy and further heated them. Even after their initial formation, these gas giants could continue to generate heat through a slow process of contraction.
In addition to impacting planetesimals and contraction, the heat from radioactive elements also played a role in heating the early planets, contributing to their differentiation into layers of distinct compositions.