Question: who wrote the music for the german national anthem
Answer: The music is the hymn `` Gott erhalte Franz den Kaiser '' , written in 1797 by the Austrian composer Joseph Haydn as an anthem for the birthday of Francis II , Emperor of the Holy Roman Empire and later of Austria .