WHITEFIELD, N.H. — Ted Cruz did not have to say a cross word about Scott Walker. Rick Perry and Bobby Jindal faded on their own. And when Ben Carson briefly rocketed to the top of the Iowa polls, Mr. Cruz and his team stayed cool, confident that the neurosurgeon’s support would wither.

But after months of assiduously following his playbook, with expected rivals for evangelical and Tea Party support exiting the race or languishing in the polls, Mr. Cruz is being forced to confront the election season’s great mystery:

How do you solve a problem like Donald Trump?

For days, Mr. Cruz — convinced, at last, that Mr. Trump will not tire from throwing punches — has been testing several strategies in succession. True to form, when dealing with Mr. Trump, the path has been complicated.

During a long bus tour of Iowa, Mr. Cruz noted that he lacked a plane with his name on it — a barely veiled effort to cast Mr. Trump as anathema to the “Iowa way” of retail campaigning. But then the state’s six-term Republican governor, Terry Branstad — who preaches to presidential candidates the importance of visiting all of Iowa’s 99 counties — urged Mr. Cruz’s defeat.