My math career had an inauspicious start. In elementary school, I was removed from the class at math time, so I didn’t “slow everyone else down.” My third grade teacher told my mother there was no need to worry about my bad math scores because math just wasn’t my thing. This started a long, tortured relationship with mathematics. My academic record in mathematics was unremarkable, inconsistent, and mostly below-average before ending early in high school.

It wasn’t until I found myself in a quantitive PhD program that I resumed a frantic, informal math education. I completed the PhD focused on pension economics that featured a very difficult math problem and now earn an income solving hard math.

But I still don’t consider myself a “math person.”

I believe that I was lucky. I loved economics so much I willed myself to become ”math person” because it was necessary. Learning lots of math turned out to be a gift that makes me employable. But my early experience was not uncommon and, sadly, probably robs many women of thousands of dollars in earnings.

Girls under-score boys in math in most OECD countries. In spite of the fact that (except for extreme cases), most boys and girls have similar intellectual ability. According to Diane Halpern, dean at Claremont Mckenna and an expert on intelligence, for most people male and female brains are equally able to be good a math. Boys have some comparative advantage in visuospatial abilities and girls appear to have stronger verbal ability and memory. But it’s impossible to tease out what’s nature and what’s environmental—they are like “conjoined twins,” according to Halpern. The fact that gaps in math achievement in the US have narrowed over time suggest environment plays a huge role, but a gap still persists (just like the gap in pay) and Halpern does not know if it will ever converge to zero.

Clancy Blair, a developmental psychologist at NYU, agrees that the messages we get as children matter, “Gender differences in math ability are largely social and cultural,” he says. The lower scores could reflect that girls, while equally able, sense a comparative advantage in verbal subjects pursue them, while not developing their math skills. Or they may be put off by hearing, like I did, that math is not for them. There is evidence that teachers, especially older and female teachers that are weak in math themselves, can have a bias (pdf) against girls math ability.

Their bias may become a self-fulfilling prophesy. Blair explains that a part of intellect is executive function, which governs how you self-regulate, process information, and problem solve. Some people are more natural at math and solve problems more efficiently. But your natural endowment of skills isn’t fixed. Performing math calculations improves executive function, and improving your executive function skills can make you better at math. Or, doing lots of math makes you smarter—even, especially, if it doesn’t come naturally to you at first. Further, there are different ways to approach problem-solving, and each may engage your brain differently. If you are taught math one way, your brain might just not connect with it, but that does not mean you are a bad problem solver—you just need to find another approach.

Blair warns that when confronted with a challenging or stressful problem, the mind can shut down and disengage. No matter how good you are at math, it gets hard at some point and this can be stressful. If you were given permission to think math is too hard for you, rather than push through, you are more likely to shut down. Blair marvels that it’s socially acceptable to be “bad at math,” but no one would ever admit to being “bad at reading.”

That may explain why children, especially girls who get mixed messages, appear incredibly susceptible when teachers or their parents tell them that math is hard or not for them. It may also explain why other countries, mainly in Eastern Europe and Asia, appear to produce better math students. Children from these countries aren’t necessarily inherently better at math—but believing that you can be bad at math and giving up is less indulged.

The good news is, even if a young girl gives into the bias, it’s probably not too late for her. I taught myself years worth of mathematics in six months at age 23. The process was painful and totally altered my thinking. Now, I know I was improving my executive function skills, which made me more employable and a better economist. Blair says my ability to learn and improve executive function was peaking around then (but he reassures me it’s never too late, our brains compensate as we age).

But the key to changing my brain was to never give up. If I couldn’t understand how to solve a problem the way one book presented it, I found another book that explained it differently. Sometimes it took shopping several different approaches before I made the connection. Math is hard, denying that or trying to make it fun, doesn’t change that fact. But the secret to becoming good at math is to always push on.