And yet, if multiculturalism is so grand, why was Mr. Trump so successful in running on a platform that rejected it? What explains the current “whitelash,” as the commentator Van Jones called it? Sure, many Trump supporters have legitimate economic concerns separate from worries about race or immigration. But what of the white nationalism that his campaign seems to have unleashed? Eight years of a black president didn’t assuage those minds, but instead inflamed them. Diversity didn’t make its own case very well.

One answer to this conundrum comes from Dr. Sommers and his Tufts colleague Michael Norton. In a 2011 survey, they found that as whites reported decreases in perceived anti-black bias, they also reported increasing anti-white bias, which they described as a bigger problem. Dr. Sommers and Dr. Norton concluded that whites saw race relations as a zero-sum game. Minorities’ gain was their loss.

In reality, cities and countries that are more diverse are more prosperous than homogeneous ones, and that often means higher wages for native-born citizens. Yet the perception that out-groups gain at in-groups’ expense persists. And that view seems to be reflexive. Merely reminding whites that the Census Bureau has said the United States will be a “majority minority” country by 2042, as one Northwestern University experiment showed, increased their anti-minority bias and their preference for being around other whites. In another experiment, the reminder made whites more politically conservative as well.

It’s hard to know what to do about this except to acknowledge that diversity isn’t easy. It’s uncomfortable. It can make people feel threatened. “We promote diversity. We believe in diversity. But diversity is hard,” Sophie Trawalter, a psychologist at the University of Virginia, told me.

That very difficulty, though, may be why diversity is so good for us. “The pain associated with diversity can be thought of as the pain of exercise,” Katherine Phillips, a senior vice dean at Columbia Business School, writes. “You have to push yourself to grow your muscles.”

Closer, more meaningful contact with those of other races may help assuage the underlying anxiety. Some years back, Dr. Gaither of Duke ran an intriguing study in which incoming white college students were paired with either same-race or different-race roommates. After four months, roommates who lived with different races had a more diverse group of friends and considered diversity more important, compared with those with same-race roommates. After six months, they were less anxious and more pleasant in interracial interactions. (It was the Republican-Democrat pairings that proved problematic, Dr. Gaither told me. Apparently they couldn’t stand each other.)

Some corners of the world seem to naturally foster this mellower view of race — particularly Hawaii, Mr. Obama’s home state. Dr. Pauker has found that by age 7, children in Massachusetts begin to stereotype about racial out-groups, whereas children in Hawaii do not. She’s not sure why, but she suspects that the state’s unique racial makeup is important. Whites are a minority in Hawaii, and the state has the largest share of multiracial people in the country, at almost a quarter of its population.