Also, cudgel one's brains. Strain to remember or find a solution, as in I've been racking my brain trying to recall where we put the key, or He's been cudgeling his brains all day over this problem. The first term, first recorded in 1583 as rack one's wit, alludes to the rack that is an instrument of torture, on which the victim's body was stretched until the joints were broken. The variant, from the same period, uses cudgel in the sense of “beat with a cudgel” (a short thick stick). Shakespeare used it in Hamlet (5:1): “Cudgel thy brains no more about it, for your dull ass will not bend his pace with beating.” Also see beat one's brains out.
The American Heritage® Idioms Dictionary Copyright © 2002, 2001, 1995 by Houghton Mifflin Harcourt Publishing Company. Published by Houghton Mifflin Harcourt Publishing Company.