But Beethoven’s Ninth is an especially slippery reference point, and may have triggered very different associations among guests at the summit. The message Ms. Merkel probably intended to send — promoting a culture of tolerance and brotherhood — may have been garbled.
Beethoven’s own intentions were not unambiguous, either. When this greatest of German composers worked on what would be his final symphony in the 1820s, his admiration for Napoleon had curdled, amid political repression, into disillusionment. In that sense, the poet Friedrich Schiller’s “Ode to Joy,” an invocation of a humanity unified in the pursuit of joy and friendship, may have felt to Beethoven like an indictment of those in power when he chose to set that text in his symphony’s great choral finale.
But then again, he ended up dedicating the Ninth to a king: Frederick Wilhelm III of Prussia.
But if Beethoven’s symphony was meant to hold up a mirror to rulers, they have tended to see in it only a flattering reflection of themselves. Hitler was fond of the piece, programming it for the opening of the 1936 Olympic Games in Berlin. In the early expansionist years of World War II, it was the most performed Beethoven work in Germany, until the tide of battle turned and Nazi presenters favored the more tragically hued Fifth Symphony.
To Soviet leaders, the Ninth sounded like a Communist anthem; during the Cultural Revolution, it was one of the few Western works of music not banned in China. The tune of “Ode to Joy” became Rhodesia’s anthem, only to be discarded with the end of apartheid and the birth of Zimbabwe. It’s become a symphonic symbol of nationalism and globalism, colonialism and freedom.
Today “Ode to Joy” is the anthem of the European Union. Its stirring melody played as Mr. Macron entered for his victory rally when he was elected in May, a signal of his continued commitment to European integration in the age of “Brexit” and nationalist surges.
Those overtones probably played a key role in Ms. Merkel’s decision to program the Ninth for the G-20 leaders. But while its text celebrates openness and equality, the work remains a touchstone of Western — and especially German — culture.
That point was also reinforced by the choice of a local orchestra and choir, with an all-German quartet of soloists. (There wasn’t, for example, the sprinkling of musicians from around the world that the New York Philharmonic’s outgoing music director, Alan Gilbert, included in a recent “Concert for Unity” performance of a Mahler symphony.) For all its invocations of a global brotherhood, Friday’s performance was also a display of German cultural pride not so different from the ceremonial sword dance with which Mr. Trump was honored during a recent visit to Saudi Arabia.
But in this election year in Germany, Ms. Merkel’s decision to put Beethoven at the center of the conference may also resonate with some of her own voters. Since her last victory at the polls, in 2013, she has stunned some of her supporters with her decision to open the country to hundreds of thousands of refugees.
Their integration remains a challenge, with many on Ms. Merkel’s center-right side of the political spectrum calling for greater insistence on Leitkultur, or lead culture: the assertion of core German values. The term can be a red flag to those who bristle at its suggestion of Eurocentric supremacy. And few works of music embody the notion of Leitkultur as neatly as the Ninth.
“We write symphonies” could thus have been the motto of Friday’s concert, too. With the added reminder that the best-known symphony of them all is, as the label might say, made in Germany.
Because of an editing error, an earlier version of this article misstated the king to whom Beethoven dedicated his Ninth Symphony. It is Frederick Wilhelm III of Prussia, not Frederick III.