According to Beatles singer-songwriter George Harrison, all things must pass, and according to decades of mathematical and astronomical models, these things include the sun.
So, when is the sun expected to burn out?
Though the ultimate death of our medium-size solar mass is trillions of years in the future, the sun's "life" in its current phase, known as its "main sequence" — in which the nuclear fusion of hydrogen allows it to radiate energy and provide enough pressure to keep the star from collapsing under its own mass — will end about 5 billion years from now.
"The sun is a little less than 5 billion years old," said Paola Testa, an astrophysicist at the Center for Astrophysics, a collaboration between the Smithsonian Astrophysical Observatory and Harvard College Observatory. "It's a kind of middle-age star, in the sense that its life is going to be of the order of 10 billion years or so."
Related: Why do the planets in the solar system orbit on the same plane?
After the sun has burned through most of the hydrogen in its core, it will transition to its next phase as a red giant. At this point roughly 5 billion years in the future, the sun will stop generating heat via nuclear fusion, and its core will become unstable and contract, according to NASA (opens in new tab). Meanwhile, the outer part of the sun, which will still contain hydrogen, will expand, glowing red as it cools. This expansion will gradually swallow the sun's neighboring planets, Mercury and Venus, and ratchet up the sun's solar winds to the point that they quash Earth's magnetic field and strip off its atmosphere.
Of course, this will almost certainly be bad news for whatever life remains on our planet by that point — assuming any has survived the 10% increase in the sun's brightness that is expected to vaporize Earth's oceans in 1 billion to 1.5 billion years, according to a 2014 study published in Geophysical Research Letters (opens in new tab). Within a few million years of this initial expansion, it's likely that the sun will also consume the rocky remains of the Earth, according to a 2008 study published in the Monthly Notices of the Royal Astronomical Society (opens in new tab).
The sun will then begin fusing the helium left over from hydrogen fusion into carbon and oxygen, before ultimately collapsing down to its core, leaving behind a gorgeous planetary nebula — a glowing shell of hot, leftover plasma — in its outer layers as it shrinks to an incredibly dense, significantly hotter, Earth-size stellar corpse known as a white dwarf. The nebula will be visible for only about 10,000 years, Testa said — the blink of an eye in cosmic time. From there, what remains of the sun will spend trillions of years cooling off before ultimately becoming a non-emitting object.
To arrive at this timeline for both the sun and all stars of its relative mass, scientists needed to know how it emitted energy, which was difficult before nuclear fusion in solar masses could be taken into account.
"A lot of the science is relatively new, like in the last century, because an integral part of understanding how a star works comes from understanding nuclear reactions and fusion," said Testa, who researches the heating mechanisms and processes of X-ray emissions, such as solar flares, in the outer layers of the sun's atmosphere. "Before the 1930s, one of the main ideas of how stars worked was that energy was coming just from gravitational energy."
Once astronomers and astrophysicists had a better understanding of fusion, they were able to come up with more complete models, coupled with emission data observed from several stars, for the lives of stars.
"By putting together lots of different information from lots of different stars, astronomers and astrophysicists could build a model for how stars evolve," Testa told Live Science. "This gives us a rather precise guess of how old the sun is."
This age — around 4.6 billion to 4.7 billion years old — is also corroborated by radioactive dating of the oldest known meteorites (opens in new tab), which formed from the same solar nebula, a swirling disk of gas and dust, that gave rise to the sun and planetary bodies in the solar system.
Thanks to these tools, scientists have a good understanding of when the sun's light will eventually burn out and fade away.
Originally published on Live Science.