There are plenty of movies about high school. Twenty-something action heroes and ingenues are easy to think of, as are stories about our Grumpy Old Men years. But try to think of a movie about middle age. Probably all that comes to mind are stories of divorce, illness, and ill-advised sports car purchases. There are exceptions, of course, but they kind of prove the rule.

In short, middle age has a pretty glum reputation, one that science agrees isn't entirely unearned. Studies show that, on average, happiness dips sometime between 40-50 before climbing again in our later decades.

It's no huge mystery why. With children and aging parents to care for and heavier responsibilities at work, midlife is often stressful. An increasingly creaky body takes some getting used to, and many youthful dreams ride off into the sunset around this time. Put all this together and, on your bad days at least, these years can feel like a joyless grind. How do you fight back? Neuroscience can help.

Climbing out of that "gray hole in the middle of life."

If you feel like some of the color has gone out of your world lately, know you're not alone. Writing on Medium recently neuroscientists Deb Knobelman explained that soon after her 40th birthday she entered an uncomfortable period. The buzz she used to get from work faded.She tried changing jobs and searching for a better work-life balance. No dice.

"I still couldn't get that same charge that I used to feel," she writes. "I kept trying all the same things that used to get me fired up, but I kept getting different results. I spent several years at a loss. In the back of my mind, I was reaching for something, but I had no idea what it was." 

All that flailing around wasn't for nothing though. After a few years, things brightened and she managed to "climb my way out of that gauzy gray hole in the middle of my life." What steps finally made the difference? Knobelman outlines three.

1. "Change your priorities, not just your circumstances."

When people start to feel itchy in middle age, they often react by changing their circumstances, resulting in the stereotypical midlife crisis divorce or sports car. Unsurprisingly, these cosmetic changes rarely help. Instead, Knobelman and science both suggest you dig deeper.

Studies show that our definition of happiness predictably changes as we age, moving from a focus on accomplishment to a larger interest in being of service and leaving a legacy. Crises often hit when we're transitioning from one definition of happiness to another and old markers of success no longer seem so meaningful.

One key to getting over you midlife malaise is to embrace rather than fight your shifting values. "I was afraid to acknowledge that my priorities had changed. Because I thought if I prioritized other things besides work and success and other externally driven things, I would take my foot off of the gas of my career. And that would mean I was no longer ambitious, or driven, or a success. Peering over that ledge made me dizzy with the possibility of an identity crisis," Knobelman acknowledges.

It was only when she allowed herself to truly evolve that she started to feel better. "I needed to let my inner voice speak and allow it to say something different than it said in my 20's and 30's," she writes.

2. Don't "Used-to Your Life Away." 

Yes, as we get older things change, and not always for the better. Your half marathon time is likely to fall, as are a few anatomical features. You feel more tired. It's unavoidable. But focusing relentlessly on what you've lost rather than what you've gained isn't.

Instead of drowning in "used to's" Knobelman now tries to "think about the beauty in the present moment. My kids are in such a good phase of life now, funny and interesting. I have the ability to say no to potential clients that will cause me more angst than is worth my time. And I've learned how to turn them down in the most direct and least dramatic way possible. I have so many freedoms that I never had before." Gratitude, it turns out, is key to happiness at every age.

3. Find a new Why. 

Knobelman is a big fan of Simon Sinek and his books Start With Why and Find Your Why. She used his wisdom to dig her way out of her midlife hole. "My Why was very different in my 20's and 30's, if I can be honest with myself. I wanted to achieve. I wanted to be a success,'" she reports. "Somewhere in my early 40's that Why stopped working for me." 

Instead of focusing on herself, Knobelman redefined success to focus more on impacting  others. Her Why went from her own glory to serving the greater good. Not only does this jive with the research I mentioned earlier on the evolution of happiness, it also echoes other psychological theories about the life stages women in particular go through.

New York Times columnist David Brooks calls this transition to broader goals climbing "the second mountain." "The first mountain is about building up the ego and defining the self, the second is about shedding the ego and dissolving the self. If the first mountain is about acquisition, the second mountain is about contribution," he has written.

The valley between them is what we call a midlife crisis. Getting through those doldrums of middle age is all about identifying that second mountain and accepting the call to climb it