sich den Kopf zerbrechen

Etymology
lit. 'to shatter one's head'.

Verb

 * 1)  rack one's brain