Now that Democrats have won control of the House, President Donald Trump must show whether he can make good on his long-standing boast that he has perfected “the art of the deal” – this time with the opposition party that he has spent the past two years denigrating.

Despite the vitriol of the midterm campaign, Trump and Democratic leaders have signaled that they are open to bipartisan cooperation.

Among the possible opportunities for common ground: a $1 trillion infrastructure plan, health care for people with preexisting conditions, controls on prescription drug prices, paid family leave – and possibly even providing a path to citizenship for immigrant children known as “dreamers,” analysts said.

“I think the president has proven that he’s interested in negotiating on a number of issues,” Rep. Conor Lamb, D-Pa., said on CNN on Wednesday, adding that Trump “has talked a lot about prescription drugs recently, and infrastructure.”

“There is no reason at all that we shouldn’t be able to come to some kind of agreement,” he said.

Still, the scenario for continued gridlock remains strong. The animosity between Trump and Democratic leaders may be too great for them to trust one another. And House Democrats are already planning to open a ream of investigations of Trump and his administration, taking up the subpoena power that has been in GOP hands for the past two years.

Trump, in a midday news conference, warned that if Democrats pursue investigations of him “all you’re going to do is end up in back and forth and back and forth, and two years is going to go up, and we won’t have done a thing.” But he also said the Democratic takeover of the House could result in a “beautiful bipartisan” situation.

“They’re the majority in the House,” the president said about the Democrats. “I expect that they will come up with some fantastic ideas that I can support, on the environment, on so many different things.”

After a campaign in which Republicans vilified Minority Leader Nancy Pelosi, D-Calif., he congratulated her, tweeting she “deserves to be chosen Speaker.”

Dan Glickman, a Democratic former congressman from Kansas and former agriculture secretary who runs a congressional program at the nonpartisan Aspen Institute, said he hopes an influx of younger party members will spur an impulse “to get things done, with less stock in the gridlock of the past.”

“I don’t think those people are going to be satisfied with the status quo,” he said.

The strongest prospect for cooperation could be a bipartisan infrastructure bill. Rep. Peter DeFazio, D-Ore., has said he met last month with a senior White House official to discuss his own infrastructure plan.

Meanwhile, Democratic leaders have put forward a $1 trillion proposal that would be financed in part by raising taxes cut in the Republican tax bill.

Although Trump is unlikely to agree to reverse his tax measure, he has said he wants to pass legislation to rebuild roads, bridges and other transportation infrastructure.

Pelosi, who is seeking to regain her post as House speaker, said in an interview Tuesday with PBS’ “NewsHour” that passing an infrastructure bill is possible.

“The president has said that that is something he wants to do. It’s always been nonpartisan, always been nonpartisan. Hopefully, we can work together to advance that agenda,” she said.

Ivanka Trump, the president’s daughter, could play a role in reaching across the aisle by stepping up her advocacy for measures with potential Democratic support. Last year, she persuaded her father to support expanding a child-care tax credit, a measure that was included in a tax bill Republicans approved.

Similarly, she has expressed support for a federal family leave plan that would give new parents six weeks of paid leave from work.

The proposal has languished. But family leave is overwhelmingly favored by Democrats and has wide support among Republicans.

However, the two parties are far apart on how to finance such a measure. Some Republicans have suggested allowing parents to take Social Security benefits early as a way to pay for the leave, while agreeing to defer retirement benefits. Some Democrats blasted the idea as a raid on Social Security benefits, suggesting instead that the measure be funded by a new payroll tax.

Carrie Lukas, the president of the Independent Women’s Forum, a conservative group that spoke positively about the Republican proposal, expressed doubt that the parties will agree on a family leave policy, given the “poisonous” political atmosphere and disagreement about how to pay for the plan.

“It would be a question of whether Democrats see this as something where they want to find common ground, or if their goal is just to thwart the White House,” Lukas said.

Another area of potential agreement could be an effort to lower prescription drug prices. Trump proposed last month that Medicare buy drugs at the lower prices available in some other countries – a savings that would be passed on to consumers.

“We are taking aim at the global freeloading that forces American consumers to subsidize lower prices in foreign countries through higher prices in our country,” Trump said.

Rep. Cheri Bustos, D-Ill., co-chairman of the House Democratic Policy & Communications Committee, said that lowering the cost of prescription drugs is a priority for her party. She said Democrats want to “stop outrageous prescription drug prices going up at a level that’s not sustainable,” enforce against price gouging and allow Medicare to negotiate for drug prices.

There also could be grounds for compromise on protecting people with preexisting conditions, a key component of the Obama-era Affordable Care Act. Although Trump has said he wants to repeal the health-care law, he has said he favors requiring insurance companies to cover people with preexisting conditions. He has not made clear how he would do that, and the debate about broader health-care legislation may begin anew.

Trump has also, at times, said he wants to protect the immigrant “dreamers” in a deal that would provide funding for a wall along the U.S.-Mexico border, a prospect that has drawn support from some Democrats.

Hanging over the House is the question of whether Democrats will pursue an effort to impeach Trump. It is possible that a report by special counsel Robert Mueller will make a case for impeachment. That is what happened in 1998, when independent counsel Kenneth Starr sent a report to Congress that presented the grounds for the impeachment of President Bill Clinton. The report was written in part by Brett Kavanaugh, a Starr aide who is now a Supreme Court justice chosen by Trump.

With his legacy and reelection at stake, Trump could either court Democrats or continue to vilify them – or both. He is, after all, a man who has changed his party registration seven times, signing up as a Democrat and a member of the Reform Party.

Democrats may question whether they can trust Trump if he offers them a deal.

“The problem is, this is a president who contradicts himself,” said Mickey Edwards, a Republican former congressman from Oklahoma and the author of “The Parties Versus the People: How to Turn Republicans and Democrats Into Americans.” “You never know if he means what he says or if he says it for the cheers he gets at the moment.”

The margin by which Democrats won control of the House could also affect whether deals will be made. As of mid-morning Wednesday, the party held a 220-194 advantage, with 21 races yet to be called.

The closer the margin, the more members will be “looking only at positioning their parties for the 2020 elections,” Edwards said. Although he said that some Democrats will try to find bipartisan consensus, others will say of Republicans, “They kicked us, we’ll kick them.”

Jason Grumet, the founder and president of the Bipartisan Policy Center, said that history has shown the potential for cooperation.

“Congress used to have the capacity to metabolize the aggression inherent in any democracy and still get things done,” he said. “It’s not, ‘Can we all get along?’ It’s the dignity of having those fights and working together.”