Neuromasochism
The process by which one derives pleasure from doing things that makes one's head hurt, particularly as applies to such pains from thinking very hard and/or attempting to reason through a very difficult problem.
Bob wants to learn to speak Latin fluently. I never knew he was in to neuromasochism!