A young man stands in the dark, waiting to take his shot. It is May 5, 2009, and Lin-Manuel Miranda is listening at the back of the East Room for his cue. The administration of the newly elected president, Barack Obama, has invited him to the White House to perform a song from In the Heights, his Tony Award–winning Broadway musical. The organizers figured he would be a bright addition to an evening of spoken word, poetry, and hip-hop — so bright, in fact, that they asked him to close the show.

Miranda has accepted the offer, but with a twist. He’s nervous that night, standing in the dark, because he’s about to perform a song that nobody has heard before, for the fanciest crowd he’s ever faced. He can see the president and first lady in the front, silhouetted in the stage light, and the enormous portraits of George and Martha Washington peering at whatever’s about to go down.

Miranda tells the audience he’s writing a hip-hop concept album about the life of Alexander Hamilton, which makes the audience laugh, because that’s a ludicrous combination of words, and then he starts rapping, which makes them laugh even more, because it really is a funny notion — a young Nuyorican spitting verses about the nation’s first Treasury secretary (in the East Room, no less, the chandeliers and gold drapes, George and Martha looking down) — but then Miranda raps faster, and with more conviction, and now nobody is laughing, because they see that he’s not joking, that he’s very serious, that this fusion of unlike parts is yielding something new and potent, something amazing, and when he’s done they leap to their feet, cheering as one, the president leading the way.

Those highly implausible four minutes are a pretty good distillation of what has happened to Miranda’s Hamilton idea ever since.

Those highly implausible four minutes are a pretty good distillation of what has happened to Miranda’s Hamilton idea ever since. The audience’s cycle of laughing, then listening intently, then breaking into wild applause has been repeated many millions of times. Hamilton has become the hottest ticket on Broadway, which is just about the least interesting thing about it. Its actors have become celebrities. Its catchphrases have crept into common usage. Its cast album just went gold. Less than a year into its run on Broadway, it has become a once-in-a-generation cultural phenomenon. Questlove, one of the album’s executive producers, cites Thriller as a point of comparison for the show’s exceptionally broad appeal — a comparison, he acknowledges, that he would call hyperbolic if somebody else had made it.

Years from now, the aspect of that White House performance that might loom largest is the identity of the president who watched it. For the most part, it’s just a coincidence that the seven years of Hamilton’s development coincided with the eight years of the Obama administration. Miranda was going to write “The Room Where It Happens” no matter who sat in the Oval Office; Obama has taken no governance cues from a Broadway musical, even if the first lady does call this one “the best piece of art in any form that I have ever seen in my life.” But that encounter in 2009 has turned out to be not a one-time connection, but the start of a relationship; not two lines intersecting, but a double helix, drawing near again and again. Now that Hamilton is fully fledged, and Obama is entering the final months of his presidency, we can see what they share, and what each reveals about the other.

To point out the affinities between Hamilton and Obama is not to make a partisan claim. Miranda didn’t write Hamilton to sync up with present-day politics; it doesn’t match the priorities of Republicans or Democrats. (If the show takes the side of any political party, it’s the Federalists, and they dissolved 200 years ago.) What the show shares with Obama lies deeper than political affiliation. It echoes an idea that has been crucial to his message since before he became president. In fact, the president, like the show, has picked up a melody that runs all the way back to the founding of the republic — the era that Hamilton revives onstage.

Gilbert Stuart / Wikimedia Commons

I got to see the connections between Obama and Hamilton from up close, and not as a neutral observer. My friend Lin told me about his crazy Alexander Hamilton idea in the summer of 2008, while he was still reading Ron Chernow’s Hamilton biography. Three years later, after I had joined the artistic staff of New York’s Public Theater, I introduced Lin to my boss, Oskar Eustis, in hopes that the Public would help to develop the show. During the middle years of the Obama presidency, as the show took shape at the Public, I was in the script meetings and set meetings and production meetings where Hamilton grew into the phenomenon we see today. When the cast performed at the White House this spring, I was there, too. The first lady said that visit felt like coming “full circle.” She meant the trajectory from 2009 to 2016, from a single song at the beginning of the presidency to a finished show near the end of it. That’s true. But to hear those songs being sung for that president, in that room, with George and Martha looking down, felt like the closing of a much bigger circle than that.

Another night, another crowd, another young man preparing for his shot. It is July 27, 2004, and Barack Obama, a little-known state senator, stands backstage at Boston’s FleetCenter, listening as he is introduced for the biggest speech of his life.

He steps onstage, smiles, tries to be cool. Which is not easy.

As the keynote speaker of the Democratic National Convention, Obama has two knotty tasks. The first is to make the case for John Kerry and his vice presidential nominee, John Edwards. The second is to make the case for himself. For this is his big break: a once-in-a-lifetime chance to establish himself as a national political figure.

But how? His career in politics has been brief: He spent much of his adult life as a community organizer and a professor. He brings no policy victories to the lectern, no Big Issue attached to his name. All he has is his own story, and an idea about America, and a vivid way of connecting the two. It may or may not be enough.

“I stand here knowing that my story is part of a larger American story,” he tells the crowd. “In no other country on Earth is my story even possible.”

“In no other country on Earth is my story even possible.”

We’ve had 12 years to get used to the message that Obama first imparted that night — years in which he has elaborated and developed it, but never really changed it. So it takes some effort to recall how bracing that message was in 2004. The audience watching him had lived through a stretch of grim years: the calamity of the 2000 election recount, the horror of 9/11, the fear and anger encoded in the Patriot Act, the nightmare in Iraq. They had heard the word “freedom” a lot, usually as an explanation, justification, and self-contained ideal rolled into one: It’s the thing the terrorists hated, and the value that America stood for, and what the 3rd Infantry Division would bring to Baghdad.

Obama, facing the cameras — a little jittery, understandably — puts his emphasis elsewhere. He unfurls the broad vision that will come to define him.

“Alongside our famous individualism,” he says, “there’s another ingredient in the American saga: a belief that we’re all connected as one people. If there is a child on the South Side of Chicago who can’t read, that matters to me, even if it’s not my child. If there is a senior citizen somewhere who can’t pay for their prescription drugs, and having to choose between medicine and the rent, that makes my life poorer, even if it’s not my grandparent. If there’s an Arab-American family being rounded up without benefit of an attorney or due process, that threatens my civil liberties. It is that fundamental belief — I am my brother’s keeper, I am my sister’s keeper — that makes this country work. It’s what allows us to pursue our individual dreams and yet still come together as one American family. E pluribus unum: Out of many, one.”

Frank Ockenfels

Hamilton, Richard Rodgers Theatre.

He’s making a subtle allusion: Without naming a name, he’s connecting his vision to Martin Luther King and inviting us to look at present-day wrongs in the light of King’s gospel of brotherhood. “Injustice anywhere is a threat to justice everywhere,” Dr. King wrote from his jail cell in Birmingham in 1963. “We are caught in an inescapable network of mutuality, tied in a single garment of destiny.” King’s ideal is a familiar refrain in politicians’ speeches, but Obama makes it sound newly vital that night — as he does E pluribus unum. While any political figure can riff on these values, almost no political figure seems to embody them. Obama is the self-described “child of a black man and a white woman, someone who was born in the racial melting pot of Hawaii,” someone whose multihued heritage makes his Christmas dinners look like “a meeting of the U.N. General Assembly.” Out of many, one.

So when he turns to address “those who are preparing to divide us,” it seems that “us” includes, well, everybody. “I say to them tonight: There is not a liberal America and a conservative America — there is the United States of America. There is not a black America and a white America and a Latino America and Asian America — there’s the United States of America.”

The crowd begins to chant his name. He keeps going.

“The pundits — the pundits like to slice and dice our country into red states and blue States: red states for Republicans, blue states for Democrats. But I’ve got news for them, too,” he says, not so jittery now. “We worship an awesome God in the blue states, and we don't like federal agents poking around our libraries in the red states. We coach Little League in the blue states, and, yes, we’ve got some gay friends in the red states. There are patriots who opposed the war in Iraq, and there are patriots who supported the war in Iraq. We are one people, all of us pledging allegiance to the stars and stripes, all of us defending the United States of America.”

Whichever America Obama was describing, we didn’t quite live in it yet.

By that night in July, the election was already showing signs of being a long, bitter trip back to 1968 and the culture-war fights of the baby boomers. (Taking the stage the next night, Kerry will evoke his wartime heroics by saying he’s “reporting for duty,” saluting the camera.) But Obama can’t refight Vietnam: He’s too young for it, and too plainly interested in moving beyond the last generation’s feuds. The November election, he says, will be a choice between “the politics of cynicism,” which expects little of the future and therefore paralyzes action, and “the politics of hope,” which expects much, and thereby empowers. His own choice is obvious, of course. He gives the impression of already living in that future America: optimistic, multiracial, all-inclusive. By the time he answers his own question, the audience is roaring.

“Hope!” he shouts. “Hope in the face of difficulty! Hope in the face of uncertainty! The audacity of hope!”

Obama didn’t just preach hope that night — he created it. That made November sting all the more. Though he won a seat in the U.S. Senate, Kerry lost the presidential election — brought down, in part, by relentless attacks on his heroism in Vietnam. Whichever America Obama was describing, we didn’t quite live in it yet.

A cold, bright afternoon at the Capitol, the president gazing at the crowd, nearly 2 million faces gazing back. “On this day, we gather because we have chosen hope over fear, unity of purpose over conflict and discord,” he says. It is January 20, 2009, and Barack Obama has just taken the oath of office.

His winning campaign — another phenomenon that went from extreme implausibility to world-beating phenomenon — had put the vision of his 2004 speech to the test. He needed a diverse new coalition to form ranks and support him: It did. He needed young people, those coming of age in the new century, to rally to his message of hope: They did. He needed small donors to give, and they gave — enough to beat the reigning family of Democratic politics and the assembled forces of the Republicans. Of course, however broad his coalition, a national election is bound to deepen divisions in the country. So in his victory night speech in Chicago, Obama enlisted the greatest reconciler in our history: “As Lincoln said to a nation far more divided than ours, ‘We are not enemies, but friends. ... Though passion may have strained it must not break our bonds of affection.’”

Looking back from 2016, we can see how quixotic Obama’s hope would turn out to be. We all learned, and quickly, that plenty of red states were happy to stay red and blue states were happy to stay blue; that the bonds of affection can be very weak, and passion very strong.

Obama has faced a solid wall of opposition at every turn. His signature victory, health care reform, passed with no bipartisan support. Increasingly he has turned to executive orders to govern — the opposite of the kind of common endeavor he described in Boston, in Chicago, and at the Capitol.

There’s nothing new about partisan opposition, of course. What’s new is the cultural upheaval that came with it. The tea party, in its name and its iconography (the tricornered hats, the actors impersonating the Founding Fathers at rallies), sought to turn a political disagreement into a debate about the nature of America. That sounds extreme, but then Obama had done the same thing, just without the hats. On election night in 2008, he claimed his victory as a sign that “the dream of our founders is alive in our time.” Because he seems to embody the kind of country that he wants America to become, it follows that he is, himself, an argument that needs rebutting. In a feverish bit of metaphor running wild, the validity of his birth certificate was called into question: The man who argued for a more encompassing Americanism had his own Americanism challenged.

Even now, in the closing months of his presidency, this backlash hasn’t abated. The New York businessman who played so outsize a role in attacking Obama’s citizenship has become, improbably, a leading candidate to succeed him. But maybe this was inevitable. Maybe the jolt that Obama gave to our notion of the country and its sense of itself back in 2004 had to inspire an answering jolt. Maybe, to put it lyrically, every action has an equal opposite reaction.

Congress kept voting to repeal Obamacare; Miranda kept writing songs. His first rap at the White House reflected his original insight, one that had come to him while reading Chernow’s biography: This guy led a hip-hop life. Hamilton was fiercely ambitious, he wrote his way out of poverty, he clashed with friends and foes alike, he died in a gunfight. By setting the nation’s founding to the dominant music of the 21st century, Miranda made it feel as timely as your Twitter feed.

The more Miranda wrote, and the more plots and characters he needed to depict, the wider the sonic palette became. On January 11, 2012 — Hamilton’s birthday — he and some friends offered the first performance of a set of Hamilton songs at Lincoln Center’s American Songbook series. There was plenty of hip-hop, sure — including the first performance of one of the Hamilton/Jefferson cabinet rap battles — but there was also Britpop (“You’ll Be Back”), R&B (“Helpless”), and countless flecks of other styles.

Charles Sykes / AP

You felt, listening to it, that Miranda had mastered a huge variety of music — that he was skimming the cream off the breadth of American culture. His ability to pack a dense rhyme (“I’m past patiently waitin’, I’m passionately smashin’ every expectation / Every action’s an act of creation!”) was impressive, but not more impressive than the quiet beauty of “Dear Theodosia,” the ballad Hamilton and Aaron Burr sing to their infant children.

In moving easily between styles, in channeling the voices of so many characters, Miranda was showing the same writerly empathy that distinguished the young Barack Obama when he wrote his memoir, Dreams From My Father. Both of them are, in a sense, translators; life has forced them to be. Obama is a black man who was raised by his white grandparents; a man who spent formative years in Hawaii, Indonesia, and Manhattan; who attended fancy colleges, then worked as a community organizer on Chicago’s South Side. Miranda is the New York–born son of Puerto Rican parents; someone who went by “Lin-Manuel” at home, where he spoke Spanish, but “Lin” at school, where he spoke English. He opened the Lincoln Center concert with a set of songs that he called “the DNA of my brain” — a mashup of Broadway tunes and hip-hop classics, a combination that didn’t seem unusual to him.

The casting that night didn’t seem unusual to him, either — though it did to other folks. As he and director Thomas Kail looked for the actors best-equipped to rap and sing his songs, they gravitated to people who, as it happened, didn’t look much like their historical counterparts. The workshops in which Miranda and Kail brought together actors to work on new material featured primarily black, Latino, and Asian performers. Only after those actors were in place did Kail raise the casting choices to a forthright ideal: “This is a story about America then, told by America now.” In a May 2014 workshop, the actors performed in costume for the first time. Seeing black and Latino actors in the uniforms of the Continental Army, winning the Battle of Yorktown, made the whole enterprise seem radical.

By January 2015, six years after Miranda’s performance at the White House, Hamilton was finally ready for its world premiere. The country was starkly, painfully divided, as President Obama had been reminded every few minutes since taking the oath of office exactly six years before that night. But in the weeks and months that followed — first at the Public, then on Broadway — just about everybody seemed to embrace Hamilton: young and old, black and white, rappers and rock stars, students and teachers — even people who you’d think might not look kindly on a musical in which rapping multiracial actors depict the Founding Fathers. Its conservative fans included David Brooks, Peggy Noonan, Rupert Murdoch, and Dick Cheney. Dick. Cheney.

When people talk about the role of the arts in our national life, the conversation tends to be dominated by the culture wars, the flashpoints when some outré performance starts everybody screaming. But as the broad embrace of Hamilton demonstrates, artistic expression more often, and more powerfully, has been an integrating force in American life. The founders set E pluribus unum as the national creed without explaining how, exactly, “one” was supposed to arise from “many.” Through artistic expression, the many have found ways to relate to each other, to understand each other, to imagine what it might be like to be one, in spite of political or regional or ethnic divides. In two long (extremely, gloriously long) sentences in Democratic Vistas, Walt Whitman explains the phenomenon best — he even seems to be looking ahead to a certain widely heralded hip-hop musical about the $10 founding father:

I suggest, therefore, the possibility, should some two or three really original American poets (perhaps artists or lecturers) arise, mounting the horizon like planets, stars of the first magnitude, that, from their eminence, fusing contributions, races, far localities, &c., together they would give more compaction and more moral identity, (the quality today most needed), to these States, than all its Constitutions, legislative and judicial ties, and all its hitherto political, warlike, or materialistic experiences. As, for instance, there could hardly happen anything that would more serve the States, with all their variety of origins, their diverse climes, cities, standards, &c., than possessing an aggregate of heroes, characters, exploits, sufferings, prosperity or misfortune, glory or disgrace, common to all, typical of all—no less, but even greater would it be to possess the aggregation of a cluster of mighty poets, artists, teachers, fit for us, national expressers, comprehending and effusing for the men and women of the States, what is universal, native, common to all, inland and seaboard, northern and southern.

Whitman saw the need for this “compaction” because he had just lived through the Civil War, an era when he tried to do with his poems what his hero and beloved contemporary President Lincoln did with prose. Both pleaded with their fellow Americans to stick together — to recognize, as Whitman put it, that individualism was only half of democracy. The other half was “adhesiveness or love, that fuses, ties and aggregates, making the races comrades, and fraternizing all” — a message that sounds a lot like Dr. King in 1963, or Obama in 2004.

Whitman had a slight acquaintance with the president: Bystanders sometimes saw those two rangy bearded homegrown geniuses nodding each other’s way on the streets of Washington. Miranda, this century’s version of a “really original American poet,” is closer to the president than Whitman was. After all, Lincoln never held up a copy of Leaves of Grass and said, This is what I’ve been trying to tell you.

Susan Walsh / AP

“You know when you’ve brought Barack Obama and Dick Cheney together that you’ve accomplished something,” says President Obama, standing on the set of Hamilton. “That is a cultural landmark.”

It’s November 2, 2015, and Obama has come to the Richard Rodgers Theatre to address a crowd of donors who are seeing the show as a benefit for the Democratic National Committee. Since it’s time to help elect his successor, it’s also time to firm up his own legacy. It’s time to recapitulate the themes he has advanced since he first stepped onto the national stage in 2004, the vision that he brought to Washington (or tried to, anyway). His arguments aren’t new, but his supporting evidence is. Time and again, he finds it helpful to cite Hamilton.

He takes the crowd back to the start of his presidency, the epochal 2008 campaign. He asks them to view his election as the country’s way “to reaffirm a fundamental belief, a belief that was on display here tonight: that people who love their country can change it.”

And that’s true — the show dramatizes that our founding documents weren’t handed down on stone tablets, and the founders weren’t saintly philosophers. They could be vain, petty, self-destructive; they fought each other as viciously as they fought the British. They stuck together anyway, sustaining a common project in spite of their disputes. There are patriots who opposed the war in Iraq, and there are patriots who supported the war in Iraq...

“The idea of America that was represented here was more than just numbers, more than just statistics,” he continues. “It’s about who we are, who’s seen, who’s recognized, whose histories are affirmed.”

That’s true, too — truer than the president could have known. The people who are literally seen in a performance of Hamilton, the men and women onstage, have been affected by the show more profoundly than anybody else. Daveed Diggs, who plays the Marquis de Lafayette and Thomas Jefferson, has said that being in the show, and seeing a black man play George Washington, has changed his relationship to the country: He feels patriotic for the first time in his life. Other cast members feel the same.

“So my primary message tonight — and this performance undoubtedly described it better than I ever could — is that we can’t afford cynicism and we can’t afford to withdraw,” the president says. “We’ve got too much work to do for that.”

And that is, as ever, the core Obama message: the necessity of hope for any kind of positive change to occur. Well, if anybody in the long course of what he called “the American saga” needed hope, it was the men and women of the founding generation, who marshaled the courage to attempt the impossible — twice. They risked their lives on the battlefield, trying to defeat the world’s most powerful empire and win their independence, something that no colonists had ever done. Then they pieced together a daring new political system, a republic bigger and more diverse than any that preceded it, which was just as hazardous, just as unprecedented. Talk about the audacity of hope.

It’s surprising, to put it mildly, that a president would find so much of his worldview reflected in a hit Broadway musical.

It’s surprising, to put it mildly, that a president would find so much of his worldview reflected in a hit Broadway musical. What’s even more remarkable is that Hamilton is a historical drama. By finding so much to embrace in a show set in the founding generation, Obama helps us to see that his vision of a unified America isn’t new — it’s been around from the country’s birth. And at some of the most painful moments of that birth, nobody expressed that vision better than Alexander Hamilton.

When New York delegates met to decide whether to ratify the new Constitution, and cynics said the federal government couldn’t unite the citizens of 13 far-flung states, it was Hamilton who faced down a hostile crowd, arguing for hope and the possibilities of change: “under the regular and gentle influence of general laws, these varying interests will be constantly assimilating, till they embrace each other, and assume the same complexion.”

When Washington decided to step down as president, it was Hamilton who drafted the first and most urgent warning in his farewell address: “Your union ought to be considered as a main prop of your liberty, and that the love of the one ought to endear to you the preservation of the other.”

Even on his deathbed, with Aaron Burr’s bullet lodged near his spine, Hamilton continued to worry that his fellow citizens would forget how hard it had been to unite the United States, how easily it could have gone wrong — and still might. “If they break this union,” he said, “they will break my heart.”

Some historians think Hamilton was playing to posterity when he said that. Very well, let’s say he was. It means that he was one of the first Americans to realize and try to make us see what Whitman, Lincoln, Dr. King, and Obama saw at later moments of crisis and division: The essential American word has never been freedom — it’s union.

The president has gone a little gray since the last time Miranda was here (again, understandably), and Miranda’s hair has grown long enough to play Alexander Hamilton — long enough to pull into a ponytail, which is how he wears it on this day. It’s March 14, 2016, and Miranda sits at one side of the East Room, watching President Obama tell the audience what we’re about to hear. The cast is arrayed in two rows to Miranda’s left; the 10-person band is to his right; the imposing portraits are exactly where he left them, right behind the stage. Obama points out that they make a powerful juxtaposition.

“We only need to look at this cast performing in front of George and Martha to know that our founders — it’s fair to say our founders couldn’t have dreamt up the future of what they set in motion,” he says.

Jacquelyn Martin / AP

Here again, Obama embodies what he describes. The slave-owning Washington would have been mightily perplexed to learn that he would be succeeded one day by a half-Kenyan man. And he would have been mystified to hear the words of his farewell address being sung by a black man (or anybody else). But as the finale to the evening’s program, Miranda and Chris Jackson step forward to sing “One Last Time,” a song from Act 2 about Washington’s decision to leave the presidency.

Jackson hails from Cairo, Illinois, on the banks of the Mississippi. (“The river of Huck,” Obama called it in one of his books, “the river of Jim.”) Seeing him play President Washington in front of the iconic portrait of President Washington, a few feet from the actual President Obama — who, in his inaugural address, called himself “a man whose father less than 60 years ago might not have been served in a local restaurant” — makes American history feel very short, very immediate. Particularly when Jackson swings his right arm to the side, precisely as Washington does in the portrait. From a certain angle, for just a moment, the two Washingtons line up exactly, a perfect double exposure.

That tableau might seem like a juxtaposition of the real Washington and a fake Washington. It’s not. The portrait, by Gilbert Stuart (another immigrant’s son), is nearly as complete a dramatic invention as Jackson singing “One Last Time.” In 1796, Stuart persuaded Washington to sit long enough to paint a likeness of the president’s face, but he relied on a body double for the rest (to the consternation of Washington’s grandson, who thought the double insufficiently imposing). The rest of Stuart’s image is fiction: There was no such table as the one seen here, carved with meaningful patriotic emblems, and no such chair, and no such grandiose crimson curtain. All of it was calculated to convey a precise meaning to audiences in 1796. It worked. A notice for the painting’s first public exhibition — also on Broadway, as it happens — said: “[Washington] is surrounded with allegorical emblems of his public life in the service of his country, which are highly illustrative of the great and tremendous storms which have frequently prevailed. These storms have abated, and the appearance of the rainbow is introduced in the background as a sign.”

Stuart’s version of Washington was attuned to the 18th century, when the young nation was coming of age. Miranda’s version, rapped and sung, by a multiracial cast, is attuned to the 21st century, when the still-young nation is on the brink of profound demographic changes. Obama will have left the White House by the time those changes are ripe. But around the country, kids in high schools and colleges will be performing the show that shares so much of his worldview — stepping into the shoes of Washington, Madison, and the rest. If, as Whitman prophesied, creative expression can be a uniquely powerful force for union, then the experience of thousands and thousands of young Americans re-enacting the founding drama of the country, in a style and language familiar to them, will have some unifying effect on this generation — however divided the legislature might be, and whoever sits in the Oval Office.

Hamilton’s return to the White House wasn’t a command performance for the enjoyment of President Obama. (Well, not entirely. “They owe me,” the president joked.) It was primarily an educational program. As Miranda and Jackson sang the words of Washington’s farewell address, with Stuart’s Washington looking over their shoulders and Washington’s successor watching from the front row, dozens of students from local high schools sat watching all three. For everybody else in the room, it was a chance to see the country as it was, and is, and will be.

Joan Marcus

Jeremy McCarter is the co-author of Hamilton: The Revolution with Lin-Manuel Miranda. He is a writer, director, and producer living in Chicago.

Jeremy McCarter is the co-author of Hamilton: The Revolution with Lin-Manuel Miranda. He is a writer, director, and producer living in Chicago.