In the episode, which centers around a cartoon version of Musk, the billionaire lands a spacecraft in the Simpsons' backyard.
Throughout the episode, Homer and his "Homerisms" inspire Musk to create new inventions, but the billionaire eventually wreaks havoc on the town in his attempts to electrify Springfield with everything from self-driving cars to a hyperloop. Eventually, his ambitious — and expensive — ideas cause mass layoffs in the town.
By the end of the episode, Homer decides the two men can no longer be friends, and Musk leaves on his spaceship to the tune of David Bowie's "Starman."
Musk has said he's been a fan of the TV show since his college years, but the executive producer Al Jean told Bloomberg they tried to avoid making the episode a "kiss-ass" gesture.
Jean told Bloomberg that Musk got to read the entire script, which takes some shots at the billionaire, ahead of time.
"He was very open to making fun of himself," Jean said. "He liked the joke where Bart is trying to guess the password to unlock Elon's self-driving car and tries 'MUSKRULZ' and it works."
Sources: "The Simpsons," Bloomberg