How can the earth and the sun BOTH be about 4.5 billion years old?
"Wouldn't the sun have formed first before the planets started appearing." ... it is more likely that the Sun and the planets formed as a unit - at about the same time.
"After all, without a sun there would be no gravitational pull from the sun to hold them in their orbits." If there were no gravity, how did the Sun form to start with?
The solar system does not orbit the Sun - the Sun and the planets all orbit their common center of mass. It is just that this is very close to the center of the Sun, so that is a good approximation for most people and OK to tell the kiddies.
In practise a ball of diffuse gas has gravity pulling all the parts of it together, towards it's center of mass. If it spins, and is a bit uneven, then several centers of attraction form... so the same process that makes the Sun also makes planets.
Devil is in the details and there are a number of models. However, there does not need to be a Sun for things to orbit. That date is pretty approximate - so the Sun may have formed a million years before the planets were recognisable as such... and that would still count as "at about the same time" for this calculation.
See: The Origin of the Solar System in the book The Sun As Star by Roger Taylor, Cambridge University Press, 1997
The Sun and the Earth both formed out of the Protoplanetary disk - Wikipedia that became the Solar System.
The Sun was a protostar for about 10 million years. During this time it was shining, but not quite in the same way as the Sun as we know it. While a protostar, it also cleared out all the remaining gas and dust that was left over in the protostellar disk - leaving the planets behind, like Earth.
This process took tens of millions of years. Since this is much smaller than 4.5 billion years (which is 4500 million years), we basically say they were born at the same time. In actuality, it is a bit difficult to say when the Sun was "born" in relation to the Earth, but it's likely that they are within a few million years of each other - which on Solar System timescales is an insignificant difference.
No - they all formed at about the same time. Big swirling cloud of dust, small rocks and gas. Total mass is equal to that of the entire solar system - so think "BIG!". Even though it's very spread out - it's gravitational field is as big as the sun. As it starts to collapse under it's own gravity (very slowly because it's so big) - the motion of the gas cloud itself causes a spin to start - conservation of momentum means that as the cloud coalesces, the spin gets stronger.
Eddies and swirls form - and those start to create planets as the sun begins to form in the center. Those denser regions of planets pull in more material and get yet denser - as they locally out-do the gravity of the newly forming sun.
However that rotation is still there - so the planets have orbital motion and that prevents them from falling into the sun.
This would be a rather slow process - and compaction of loose debris into solid rocks doesn't have a precise start and endpoint - so the precise order of formation of sun and planets isn't subject to exact dating.
"The oldest material found in the Solar System is dated to 4.5672±0.0006 billion years ago (Gya). By 4.54±0.04 Gya the primordial Earth had formed. The formation and evolution of Solar System bodies occurred along with the Sun. In theory, a solar nebula partitions a volume out of a molecular cloud by gravitational collapse, which begins to spin and flatten into a circumstellar disk, and then the planets grow out of that disk along with the Sun. A nebula contains gas, ice grains, and dust (including primordial nuclides). According to nebular theory, planetesimals formed by accretion, with the primordial Earth taking 10–20 million years (Ma) to form.
"A subject of on-going research is the formation of the Moon, some 4.53 billion years ago." (Earth - Wikipedia)
All around 4.5 billion years, but lasting tens of millions of years.
It depends how precise you measure the age. A tolerance of +- 0.01 billion years is still around 10 million years, which is still a long time in the formation of planets and stars.
The Earth took roughly 10–100 million years, while the Sun took roughly 100,000–50 million years to fully form into a star that fuses Hydrogen to Helium.
To elaborate the sun formed first while the rest of the early mass propagated throughout the Solar System to form planetary bodies.
Despite this, there are theories looking to disprove the prior formation of the Sun, stating that the Earth formed first.
Yes the Sun formed before the Earth coalesced but
- the time between the formation of the Sun and the Earth is << 4.5 billion years (so that we can approximate both as the same age), and
- we acknowledge that radioactive dating of solar system bodies can only provide a lower limit to the age of the sun.
So the sun is slightly older than the Earth, but it is difficult to pinpoint it more precisely than that.