Four billion years from now, our galaxy, the Milky Way, will collide with our large spiraled neighbor, Andromeda.

The galaxies as we know them will not survive.

In fact, our solar system is going to outlive our galaxy. At that point, the sun will not yet be a red giant star – but it will have grown bright enough to roast Earth’s surface. Any life forms still there, though, will be treated to some pretty spectacular cosmic choreography.

Currently, Andromeda and the Milky Way are about 2.5 million light-years apart. Fueled by gravity, the two galaxies are hurtling toward one another at 402,000 kilometers per hour. But even at that speed, they won’t meet for another four billion years. Then, the two galaxies will collide head-on and fly through one another, leaving gassy, starry tendrils in their wakes. For eons, the pair will continue to come together and fly apart, scrambling stars and redrawing constellations until eventually, after a billion or so years have passed, the two galaxies merge.

Then, the solar system will have a new cosmic address: A giant elliptical galaxy, formed by the collision and merger of the Milky Way and Andromeda.

This isn’t a chapter ripped from science fiction – it’s a real, scientific prediction. That science can forecast such events was the focus of the third episode of Cosmos: A Spacetime Odyssey. That Newton could describe the orbits of planets, and Halley the return of his eponymous comet, and contemporary astronomers, the end of the Milky Way – this gift of foresight is really a mathematical understanding of the physical laws that govern the movements of celestial bodies.

“Using nothing more than Newton’s laws of gravitation, we astronomers can confidently predict that several billion years from now, our home galaxy, the Milky Way, will merge with our neighboring galaxy, Andromeda,” host Neil DeGrasse Tyson says. “Because the distances between the stars are so great compared to their sizes, few if any stars in either galaxy will actually collide. Any life on the worlds of that far-off future should be safe, but they will be treated to an amazing, billion-year long light show.”

The galactic collision that closes out the third Cosmos episode follows the sequence in the animation below, which is based on a 2006 simulation by astrophysicist Brant Robertson*.

Now, how on Earth do we know this is going to happen?

The story starts in the early 1900s, when astronomer Vesto Slipher measured the radial velocity of Andromeda — in other words, he calculated the speed at which the galaxy was moving toward or away from Earth. Slipher did this by looking for a telltale stretching or compression in the light from Andromeda arriving at Earth: Light from objects that are moving away from us is slightly stretched, or red-shifted. Light from objects moving toward us is blue-shifted, or compressed.

The result was a little bit surprising.

“We may conclude that the Andromeda Nebula is approaching the solar system with a velocity of about 300 kilometers per second,” Slipher wrote in the Lowell Observatory Bulletin in 1913 (Andromeda was called a nebula back then because astronomers didn’t realize it wasn’t part of the Milky Way; Slipher’s calculation strongly suggested that idea needed rejiggering).

So Andromeda was zooming toward us – that much at least seemed clear. Whether its arrival would mean the end of the Milky Way was still uncertain. For decades, scientists had no way of knowing whether Andromeda and the Milky Way would collide head-on, or if they would slip past one another like star-filled vessels in the cosmic night.

Turns out, it’s relatively easy to measure the velocity of faraway objects moving toward or away from us, but much more difficult to determine their sideways motion (something astronomers call “proper motion”). The farther away something is, the harder it is to measure its sideways motion, which doesn’t produce those telltale stretched or compressed wavelengths that astronomers can work with. Instead, astronomers rely on detailed observations of an object’s position relative to background stars – a small and subtle shift that without superior telescopes can take centuries to become apparent.

View Images Artist’s conception of the future Earth, whose oceans have boiled away due to the Sun’s increasing heat, exiled to the outskirts of the new merged galaxy that astronomers have dubbed “Milkomeda.” (David A. Aguilar, CfA)

Avi Loeb

Loeb and then post-doc T.J. Cox simulated the impending collision and merger of Andromeda and the Milky Way using estimates of Andromeda’s proper motion. Their results showed a better than decent chance of the two galaxies smashing into one another, and a pretty good possibility of the solar system being punted to the outskirts of the resulting elliptical galaxy, which Loeb named “Milkomeda.”

In 2012, a team of astronomers based at the Space Telescope Science Institute re-did the collision calculations, this time using direct measurements of Andromeda’s proper motion. After all those years, the team was able to get those measurements with the Hubble space telescope – and an observing campaign that used years of data, beginning with images snapped in 2002.

“We compared images taken at different times with the Hubble Space Telescope, and measured how much the Andromeda stars have moved relative to the fuzzy galaxies in the distant background,” says astronomer Sangmo Tony Sohn. “This gives us a sense of how fast the Andromeda stars moved across the sky.”

The team concluded that Andromeda’s proper motion was tiny – and that a head-on collision was pretty much inevitable. That might sound a little bit traumatic, but it’s not all that unusual for galaxies to merge. The Hubble space telescope has captured some glorious images of faraway mergers and collisions, and astronomer Halton Arp included a number of galactic interactions in his “Atlas of Peculiar Galaxies,” published in 1966. They’re all really pretty.

The good news is that, as Tyson says, stars are so far apart that even though galaxies are colliding, the probabilities of stellar collisions are small. So the sun and its planets will likely survive the birth of Milkomeda, though Earth will no longer be able to call the Milky Way home. And we’ll no longer live in a spiral galaxy: Milkomeda will be elliptical in shape, and it’ll probably look pretty red, which you can see toward the end of the 2012 team’s animation, and in the animation above.

So there’s no doubt this merger is going to be a spectacle – and there’s a good chance that the Triangulum, a smaller, nearby galaxy, will get sucked into the fray. I, for one, am disappointed that I won’t be able to watch this great cosmic light show. For now, the best I can do is enjoy the sequence of illustrations below.

View Images Present day; 2 billion years from now; 3.75 billion years; 3.85 billion years; 3.9 billion years; 4 billion years; 5.1 billion years from now; and 7 billion years from now, when the galaxies have formed a huge elliptical galaxy.