A study in the British Medical Journal lit up the Internet last week with the conclusion that cognitive decline begins at age 45. While it’s true that some innate skills like memory and speed of reasoning fall off as we age, other aspects of intelligence related to learning and experience actually improve.

These findings are part of a wave of new research on the psychology and neuroscience of middle age. Like baby boomers before them, Gen X-ers are learning that entering middle age often means getting squeezed between the demands of raising children, holding down a job and taking care of aging parents. But despite the high levels of stress, people in their 40s, 50s and early 60s generally have a happier outlook than their younger counterparts. They feel more competent and in control — that they can personally take steps to influence what happens in their life. They are also less neurotic, more open, reflective and flexible.

Researchers suspect that one reason middle-aged people are more resilient is that their brains have learned to accentuate the positive and eliminate the negative. Using brain imaging to peek inside that 3 lb. of gray and white matter, researchers at the University of Wisconsin found that in younger adults, the amygdala, the brain’s emotional nut, was activated when they looked at upsetting as well as uplifting images. Adults in their middle and upper decades, by contrast, seemed to have the ability to screen out or tamp down negative emotions; their amygdalas lit up when they saw positive images but tended to ignore disturbing ones.

In a 2011 study, researchers monitored involuntary facial expressions and eye blinks as a way of assessing responses to emotionally charged pictures. The biggest difference between younger and older participants turned out to be in their reactions to neutral images. The more mature subjects were more likely to put an optimistic spin on ambiguous information — they had what has been called the “positivity offset,” a predisposition for upbeat interpretations. People with a positivity offset, for example, have been found to judge fictional characters described in neutral terms more positively.

Why do they do this? One theory is that the older people get, the more importance they place on maintaining a sense of well-being, even if it means downplaying contrary information. In this case, nature and nurture may be working hand in hand. By middle age, people have had their share of life experiences; they have had the opportunity to learn how to cope with a canceled flight, an office feud, a broken ankle, a nagging parent, a traffic ticket or a lost cell phone. These experiences are imprinted on the mass of brain cells, carving new neural pathways and cataloging responses that can be retrieved as needed. This may be why people in middle age report that they are better able to handle stressful conflicts with their friends and family members and that they feel more capable of riding herd on their own emotional ups and downs. Something that may have floored them when they started out is taken in stride in their middle decades.

The evidence is tattooed on the brain. Researchers at the University of Toronto recently found that contrary to the popular belief that the brain loses cells as it ages, white matter — bundles of nerve transmitters that are wrapped and insulated in a fatty molecule called myelin — continues to grow during middle age, providing what scientists call brain reserve. A famous study of London cabbies, who are required to master 320 routes comprising 25,000 streets, found that the more experienced the driver, the larger was their posterior hippocampus, the peapod-shaped area related to memory. As Ralph Waldo Emerson wrote, “The years teach much which the days never knew.”