WASHINGTON — President Obama on Wednesday placed a wreath at President Kennedy's grave, marking 50 years since the assassination that helped shape the presidency and every man who has held the office since.

Obama was just 2 years old, a babbling toddler living in Hawaii, when Kennedy was shot. He is the first president with no memory of the moment.

That time and distance have undoubtedly shaped how Obama views the legacy of Kennedy, a figure who would be mythologized in popular culture and turned into a Democratic icon by the time Obama came of age politically.

But that generational distance has not kept Obama from using parts of the Kennedy aura — youth, optimism and glamour — to his advantage, just as most of his intervening predecessors sought to do.

Kennedy comparisons were central to the narrative of Obama's first bid for the White House, culminating in a pass-the-torch endorsement from the slain president's daughter, Caroline, who declared that for first time she'd found a candidate "who inspired me the way people tell me that my father inspired them."

PHOTOS: JFK assassination, 50 years later

Nearly six years later, such comparisons are far less frequent, a fact that speaks to both our national brand of Kennedy nostalgia and Obama's sinking political position.

Because his life and term in office were cut short, Kennedy represents "the glow of idealism and promise" in American politics and not the hard slog of governing, said Leonard Steinhorn, a professor at American University in Washington who has written on politics and the baby boomer generation.

At the moment, Obama is on the slog. The disastrous launch of the insurance marketplaces created by his healthcare law has rattled his administration, frustrated allies and emboldened his opposition. His broken promise that all consumers could keep their existing insurance has many Americans looking at Obama in a different light. Polls show not only his approval rating at a new low, but his once-solid ratings of trustworthiness and honesty slipping too.

On Wednesday, a day filled with Kennedy tributes, Obama tried to refocus on the idealism and promise as he awarded Medals of Freedom, an honor created by Kennedy, who was killed before he ever bestowed it. Obama gave the medal to Chicago Cubs great Ernie Banks, Oprah Winfrey and former President Clinton, among others.

"I hope we carry away from this a reminder of what JFK understood to be the essence of the American spirit — that it's represented here," Obama said. "And some of us may be less talented, but we all have the opportunity to serve and to open people's hearts and minds in our smaller orbits."

Obama and Clinton, a politician expert at evoking Kennedy's memory, then traveled to Arlington to lay a wreath at the eternal flame marking Kennedy's grave. The presidents stood quietly, hands on hearts, as a bugler played taps at a ceremony attended by members of the Kennedy family. Afterward, Obama picked up a Kennedy baby, an 11-month-old great-grandchild of Sen. Robert F. Kennedy, who was assassinated five years after his brother as he sought the presidency.

GREAT READ: Witnesses to JFK’s tragedy

At an evening reception for the Medal of Freedom honorees at the Smithsonian American History Museum, Obama said Kennedy looms large in the American imagination not just because of his youth and talent, but because he was "defiant in the face of impossible odds and, most of all, determined to make the world anew."

"In his idealism, in his sober, square-jawed idealism, we are reminded that the power to change this country is ours," Obama said.

In the 50 years since the JFK assassination, all presidents have had to forge their own relationships with the Kennedys. In his first term, Obama referred to JFK 99 times, according to an analysis by Larry Sabato, a political scientist at the University of Virginia whose new book, "The Kennedy Half-Century," explores the Kennedy legacy in American politics. The number pales next to Clinton's 327 Kennedy references in his first term and President Carter's 165.

But no one navigated the tricky waters of Kennedy nostalgia better than a Republican, Ronald Reagan, Sabato said.

Reagan so frequently quoted Kennedy to bolster his hard line on the Soviets and his push for tax cuts that Democrats started to complain. Reagan's solution was to raise money for the Kennedy Library, Sabato said, winning him a thank-you note from John F. Kennedy Jr. that essentially gave the president permission to cite his father as often as the president pleased.

"His charm offensive kept the Kennedys basically friendly on a personal level for eight years and beyond," Sabato said.

President George W. Bush preferred to quote Reagan over Kennedy, Sabato noted, but he, too, benefited from a Kennedy courtship. Early in his first term, Bush invited Sen. Edward M. Kennedy and other family members to the White House to see a new film about the Cuban Missile Crisis. The evening sparked the beginning of a partnership on education legislation between the senator and the president, which led eventually to the No Child Left Behind law.

Clinton's political creation story was tied to Kennedy and bolstered by a photo of a fresh-faced teenage Clinton shaking hands with the president during a trip to Washington.

Obama sought to create such a moment in his own story — but that was a harder stretch for a kid raised in the '60s in Hawaii and Indonesia.

TIMELINE: JFK assassination

When he accepted the endorsements of Caroline and Edward Kennedy in 2008, candidate Obama said he'd learned that a program funded by the Kennedy family had brought 81 Kenyan students, including his father, to study in the U.S. in 1959. Obama's campaign later had to retract the story; the Kennedy donation to the program came after Obama's father had arrived in the U.S.

During a swing through Latin America this year, Obama evoked Kennedy's Alliance for Progress. A few weeks later, he delivered a major speech in Berlin, where Kennedy famously spoke. In South Africa this summer, Obama delivered a long reflection on Robert Kennedy's "ripples of hope" speech from the same university where the senator had blasted apartheid.

Obama has often focused on that idea of hope in remarks on the Kennedy legacy.

"In the stories I heard growing up, I saw how my grandparents and mother spoke about them, and about that period in our nation's life — as a time of great hope and achievement," he said in 2008. "I think my own sense of what's possible in this country comes in part from what they said America was like in the days of John and Robert Kennedy."

kathleen.Hennessey@latimes.com