President Barack Obama went through multiple emotional stages after Donald Trump's election - sometimes angry, sometimes resigned - as he talked to aides about the 'cartoon' figure who cared more about crowd size than policy, as he referred to the president-elect who would follow him into the Oval Office.

Obama also expressed rare self-doubt, wondering whether he had misjudged his own influence on the country.

The revelations on the former president's inner thinking came to light in a new memoir - 'The World as It Is' - by his longtime adviser Benjamin J. Rhodes that is scheduled to be published next week but was previewed inThe New York Times.

SCROLL DOWN FOR VIDEO

President Obama wondered whether he had misjudged his own influence on the country after voters picked Donald Trump to follow him into the Oval Office.

New book reveals President Obama did not know the FBI was investigating possible ties between the Trump campaign and Russia.

He described Obama as heavily shaken at the thought of being replaced by a man who had questioned his birth. Trump repeatedly asked to see Obama's birth certificate for proof his was born in America - a requirement to be the president.

'Sometimes I wonder whether I was 10 or 20 years too early,' he quoted Obama as saying.

Rhodes claims neither he nor Obama knew at the time that there was an FBI investigation into contacts between Trump's campaign and Russia. The former Obama aide said he did not learn of the investigation until after he left the White House.

However, the White House was worried about possible Russian influence on the election.

Obama had authorized a statement from intelligence agency leaders a month before the election warning of Russian interference, but the then-president was thwarted from doing more because Republican Senator Mitch McConnell refused to go along with a bipartisan statement on the issue.

The book also reveals Obama didn't want to speak too much of possible Russian tampering because he was convinced Hillary Clinton would win and that Trump would say the election was manipulated.

'If I speak out more, he'll just say it's rigged,' Obama said.

Rhodes also revealed the Obama White House was confident Clinton would win and was in shock when she did not.

'I couldn't shake the feeling that I should have seen it coming,' he wrote. 'Because when you distilled it, stripped out the racism and misogyny, we'd run against Hillary eight years ago with the same message Trump had used: She's part of a corrupt establishment that can't be trusted to bring change.'

After the election, Obama focused on cheering up his staff.

'I don't know,' he told aides. 'Maybe this is what people want. I've got the economy set up well for him. No facts. No consequences. They can just have a cartoon.'

And during Obama and Trump's post-election meeting, the president-elect repeatedly bragged about the size of his campaign rallies compared to Clinton's.

In the aftermath of Trump's victory, Obama urged Canadian Prime Minister Justin Trudeau to take on a more vocal role defending the values they shared on the world stage.

The Obama White House was confident Hillary Clinton would win the 2016 election and was in shock when she did not.

During Barack Obama and Donald Trump's post-election meeting, the president-elect repeatedly bragged about the size of his campaign rallies compared to Hillary Clinton's.

German Chancellor Angela Merkel told Obama she felt more obliged to run for another term because of Trump's election. When they parted for the final time, Merkel had a single tear in her eye. Obama said of her: 'She's all alone.'

Rhodes served as Obama's deputy national security adviser through some of the most consequential points of his presidency, including decisions to authorize the raid that killed Osama bin Laden, the escalation of troops in Afghanistan, and the refusal to intervene militarily in Syria.