rack one's brain

[rack one's brain] {v. phr.} To try your best to think; make agreat mental effort; especially: to try to remember something you haveknown.

Bob racked his brain trying to remember where he left thebook.

Susan racked her brain trying to guess whom the valentinecame from.

John racked his brain during the test trying to solvethe problem.