Raising children is hard, and any parent who says differently is lying. Parenting is emotionally and intellectually draining, and it often requires professional sacrifice and serious financial hardship. Kids are needy and demanding from the moment of their birth to… well, forever.

Don’t get me wrong. I love my children dearly, and can’t imagine my life without them. But let’s face the facts: Study after study has shown that parents, compared to adults without kids, experience lower emotional well-being — fewer positive feelings and more negative ones — and have unhappier marriages and suffer more from depression. Yet many of these same parents continue to insist that their children are an essential source of happiness — indeed that a life without children is a life unfulfilled.

How do we square this jarring contradiction? Two psychological scientists at the University of Waterloo think they have the answer. They suspect that the belief in parental happiness is a psychological defense — a fiction we imagine to make all the hard stuff acceptable. In other words, we parents have collectively created the myth of parental joy because otherwise we would have a hard time justifying the huge investment that kids require.

In the jargon of the field, this is called “cognitive dissonance” — the psychological mechanism we all use to justify our choices and beliefs and preserve our self-esteem. Richard Eibach and Steven Mock decided to explore the role that such self-justification plays in parental beliefs about their irreversible choice to have and raise children. They focused on economic hardship, and here’s how they studied the costs of parenthood in the lab:

They recruited 80 fathers and mothers, each parent with at least one child under age 18. The parents were about 37 years old on average, and the kids were about eight. Half the parents were primed to focus on the financial costs of parenting. They read a government document estimating that the costs of raising a child to age 18 exceed $190,000. The other parents got this information as well, but they also read about the financial benefits of parenting — that is, the fact that adult children often provide financial and practical support to aging parents. The idea was that some of the parents would be mentally calculating the out-of-pocket costs of having kids, while others would be left thinking of children as a mixed blessing, at least financially.

Then the scientists gave the parents a psychological test designed to measure how much they idealized parenting: Did they agree strongly (or not) that there is nothing more rewarding than raising a child? Do adults without kids experience emptiness in their lives? And so forth.

Finally, they measured the parents’ feelings of mental and emotional dissonance: Do you feel uncomfortable, uneasy, bothered?

Eibach and Mock were testing a couple ideas. First, they suspected that parents who were focused on the costs of parenthood would be more likely to experience feelings of conflict and discomfort — because they would be torn between the reality they have chosen and the costs of that choice. But second, they also expected that these negative feelings would motivate them to idealize parenthood in order to trump the negative feelings.

And that’s what they found, with a slight twist. If they measured the parents’ feelings of emotional discomfort immediately after priming their thoughts about cost, they felt much worse than did the parents with a more mixed view of parenting. They were conflicted. But if the scientists first gave them the opportunity to idealize parenting and family life, and then measured their conflicted feelings, those negative feelings were gone. In short, thinking about the high costs of children created significant emotional discomfort, which motivated the parents to focus on the joys of parenting, which in turn dissipated the uneasiness over choosing such a difficult path.

As a parent, I find this remarkable and discomfiting. How else might I be fooling myself in order to justify the high costs of my decision to be a parent? The scientists were curious about this, too, and designed a different version of the experiment to find out. In this study, parents were again primed to think about their pricey life choice or both costs and benefits of parenting. But this time, the researchers asked the parents about their intrinsic enjoyment of various life activities: One was spending time with their children, and others were spending time with a romantic partner, or engaging in their favorite personal activity. They also asked them how much leisure time they hoped to spend doing something with their child on their next day off from work.

The results were clear. As reported on-line in the journal Psychological Science, the parents who had the high costs of children in mind were much more likely to say that they enjoyed spending time with their children, and they also anticipated spending more leisure time with their kids. In other words, being aware of parenthood’s price tag made them idealize the time they spent with their kids, and this idealized image of family life led them to foresee more shared time in the future.

All this makes sense from a historical perspective, the scientists point out: In an earlier time, kids actually had economic value; they worked on farms or brought home paychecks, and they didn’t cost that much. Not coincidentally, emotional relationships between parents and children were less affectionate back then — and childhood was much less sentimentalized. Paradoxically, as the value of children has diminished, and the costs have escalated, the belief that parenthood is emotionally rewarding has gained currency. In that sense, the myth of parental joy is a modern psychological phenomenon.

This doesn’t strike me as a bad thing entirely. We may be uneasy thinking of our families as all dollars and cents, but bank accounts don’t lie. If knowing the bottom line makes us want to spend more time on kids instead of, say, TV or golf or work, that sounds like a healthy bargain for all involved.