(Tracy A. Woodward/The Washington Post)

When his oldest son reached school age, Michael Petrilli faced a dilemma known to many middle-class parents living in cities they helped gentrify: Should the family flee to the homogenous suburbs for excellent schools or stay urban for diverse but often struggling schools?

Petrilli, who lived in Takoma Park with his wife and two sons, was torn, but he knew more than most people about the choice before him. Petrilli is an education expert, a former official in the Education Department under George W. Bush and executive vice president at the Thomas B. Fordham Institute, a right-leaning education think tank.

He set out to learn as much as he could about the risks and benefits of socioeconomically diverse schools, where at least 20 percent of students are eligible for the federal free or reduced-price lunch program. And then he wrote about it.

The result is “The Diverse Schools Dilemma,” which is being published and released next month by the Fordham Institute.

Petrilli said he wanted his son to have friends from all backgrounds because he believes that cultural literacy will prepare him for success in a global society.

But he worried that his son might get lost in a classroom that has a high percentage of poor children, that teachers would be focused on the struggling children and have less time for their more privileged peers.

As Petrilli points out in the book, this dilemma doesn’t exist for most white, middle-class families. The vast majority — 87 percent — of white students attend majority white schools, Petrilli says, even though they make up just about 50 percent of the public school population.

And even in urban areas with significant African American and Latino populations, neighborhood schools still tend to be segregated by class, if not by race. In the Washington region, less than 3 percent of white public school students attend schools where poor children are the majority, according to Petrilli.

Gentrification poses new opportunities for policymakers to desegregate schools, Petrilli argues.

One solution is public charter schools, which now educate 41 percent of D.C. public school children, Petrilli said. Enrollment is not based by neighborhood; charter schools draw students from across the city. Some of the most popular charters are among the most diverse schools in the city.

But some middle-class parents find themselves at odds with the culture of some charter schools, Petrilli said.

“Many of the charters have uniforms and a rigid discipline code,” he said. “It’s not a culture that celebrates a lot of individualism, personal style or autonomy, the kinds of things that middle-class parents may want. So there are significant differences and cultural clashes that take place.”

Another route is a controlled choice system, where a portion of seats in a neighborhood school are set aside for children who don’t live in the neighborhood but meet poverty standards.

Controlled choice, first adopted by Cambridge, Mass., in 1981, is controversial. “You need political will to do this,” Petrilli said.

In the end, Petrilli moved from his Takoma Park neighborhood school — diverse Piney Branch Elementary, which is 33 percent low-income — to Wood Acres Elementary in Bethesda, where 1 percent of the children are low-income, 2 percent are black and 5 percent are Hispanic.

“It’s hard to get much richer or whiter than that,” Petrilli writes.

And it haunts him.

“I think about it every day,” he said. “Now we live in the suburbs and miss the urban vibe of Takoma Park quite a bit. . . . At the end of the day, we all do what’s best for our kids. I hope writing about it honestly can help people make their own decision.”