A new study suggests the best way to get over a breakup is to fake it until you make it.

Researchers at the University of Colorado Boulder found that simply believing you’re doing something positive to get over your ex can influence brain regions associated with emotional regulation and lessen the pain you’re feeling. In other words, remaining open to the possibility that what you’re doing could potentially make you feel better works like a placebo effect.

Researchers Leonie Koban and Tor Wager and their team at CU Boulder studied 40 young people who’d experienced an unwanted breakup in the past six months. The participants were asked to bring in two photos: one of their ex and one of a close friend.

Inside a functional magnetic resonance imaging (fMRI) machine, the heartbroken parties were shown images of their exes and asked to reflect on the breakup. Then they saw the images of their friend (the control variable).

They were also given a jolt of physical pain (a hot stimulus on their left forearm).

As these stimuli were alternately repeated, the participants were asked how they felt on a scale of 1 (very bad) to 5 (very good). Meanwhile, the fMRI machine tracked activity in the brain.

The machine showed similar areas of the brain lit up during both emotional pain (reminiscing and looking at the ex pic) and physical pain — suggesting that the heartache you feel after a breakup is very real and not just in your head.

For part two of the study, the subjects were taken out of the machine and given a nasal spray. Half were told the spray was a “powerful analgesic effective in reducing emotional pain,” while the rest were told it was merely a saline solution.

The subjects then went back in the fMRI machine and experienced the same painful stimuli as before, but this time, the placebo group felt less physical and emotional pain.

When they were shown the photo of their ex, there was reduced activity in the areas of the brain associated with social rejection.

“The placebo nasal spray made people feel substantially better about viewing pictures of their ex-partners — on the brain as well as on people’s feelings,” said Wager, a senior author of the study.

If you’re nursing a broken heart, Wager said the takeaway of his study should be that your beliefs about the future matter more than you think.