copied & pasted directly from the Simpsons 'wiki' page.
Uncredited writer of "Do the Bartman"????? Come on!
Michael Jackson (August 29, 1958 – June 25, 2009) was a singer who guest starred on The Simpsons in the episode "Stark Raving Dad". He performed the speaking voice of Leon Kompowsky under the pseudonym John Jay Smith. Jackson was a fan of the show, and called Matt Groening one night and offered to do a guest spot. The idea for the episode was pitched by James L. Brooks and the script was written by Al Jean and Mike Reiss. In an early version of script, Homer decided to take Barney Gumble in for rehab, but whilst there Homer began acting crazily so the doctors assumed he was the one to be committed. Jackson pitched several story ideas for the episode, including Bart telling everyone in town that Michael Jackson was coming to his house. He also requested several script changes, including that he wanted to have a scene in which he and Bart wrote a song and asked that a joke about Prince be changed to one about Elvis Presley.
Jackson especially liked Bart and wanted to give him a number one single, so he wrote much of the song "Do the Bartman" although he did not receive credit for it. Jackson also wrote the song "Happy Birthday Lisa" for the episode, which was later included in the album Songs in the Key of Springfield.
One of Michael Jackson's conditions for guest starring was that he voiced himself, but a sound-alike would receive credit. While he recorded the voice work for the character, all of his singing was performed by Kipp Lennon, because Jackson wanted to play a joke on his brothers and fool them into thinking the impersonator was him. Michael Jackson's lines were recorded at a second session by Brooks. Jackson showed up for the recording session alone and did not use the special trailer that was set up for him. Lennon and Jackson recorded their parts at the same time, and Jackson found Lennon's impersonations hilarious. Jackson actually did record versions of the songs, and while there have been rumors that those tracks were the ones used in the final episode, Simpsons music editor Chris Ledesma says the Lennon versions were used. Leon Kompowsky's normal speaking voice was recorded by Hank Azaria.
The producers of the show were legally prevented from confirming Jackson guest starred at the time, although many media sources assumed it was really him. After this episode the producers decided that if a celebrity wished to guest star on the show, they had to be willing to be credited under their real name and not a pseudonym.