'I know this sounds like a cliché, but really, it's not you…" I stopped listening at this point. I knew what was coming. In my mind I had already dumped myself several times before Lizzie finally got round to doing it. She was clever, talented, beautiful; and I had lost her in a personal best time of six weeks.

"Perhaps you were too nice," a friend, Flora, suggested a couple of days later.

"Don't be ridiculous."

"You've got to play the game – play hard to get."

And then it clicked. "You mean, like, restrict my supply?"

She rolled her eyes, a reaction I was used to getting whenever I translated something, quite unnecessarily, into economic language. "I guess you could put it like that."

A few days passed. The initial shock began to wear off. Perhaps we weren't right for each other after all. Anyhow, I shouldn't really have expected it to end any other way. I had gone on plenty of dates but no relationship had lasted. Whenever I did find a girl I liked, I let my emotions build up too much steam, and she would run.

Yet, as an economist, I had always prided myself on my ability to think rationally and get myself out of even the most complex of problems. And now, thinking about it, the idea that I had oversupplied myself seemed to make a lot of sense. I started thinking about what else I might be able to learn from applying the principles of economics to my love life – or lack of it.

The theory that people have a market value, rather than an intrinsic or absolute value, has been around for centuries. Thomas Hobbes, the 17th-century political philosopher, believed we are essentially worthless, and are valuable only to the extent that others think we are. In short, we are prey to the opinions and demands of the market. One day the market might want blondes, the next brunettes, and those blondes and brunettes will see their price vary accordingly.

Online dating is perhaps the most clearcut example of market principles in the world of romance, but there is evidence everywhere. It is common to speak of ourselves as being "back on the market" when we've ended a relationship, or "damaged goods" after a traumatic break-up.

Likewise, we are all familiar with the idea of playing hard to get – although this particular concept, as I soon learned, is rather more complicated than it first seems. Usually when we try to sell something, and don't find any takers after some time, our natural response is to cut the price, and continue to do so until we find a willing buyer. Playing hard to get, however, results in an increase in price, not a decrease.

Most goods fall into one of two categories: essential goods, or luxury goods. We generally prefer essential goods, such as staple foods, drinks and household items, to be as cheap as possible. This is not the case, however, for luxury items, such as jewellery and fast cars, whose relative value derives not only from their quality, but also from their exclusivity. For instance, people buy Rolex watches not necessarily because they tell the time better than, say, a Timex, but because they are beyond the reach of most people. To maintain this status-symbol quality, Rolex makes very few watches, and charges a lot for them. If Rolex increased the number it produced, the price of the watches would fall.

When it comes to marketing ourselves, it looks as if playing hard to get is, in part, as for Rolex watches, an effort to maintain our status as luxury goods. We want to brand ourselves as someone that only the very best could be with. For one's affections to come too easily makes the recipient feel that just about anyone else could have, or already has, been in their shoes.

However, as I discovered, playing hard to get in the initial stages of courtship – when you are trying to meet someone in a bar or at a party – doesn't really work. There's so much competition that any attempt to increase your price may actually make you less attractive. When I first tried testing this theory, I approached a girl in a club, only to leave her mid-conversation to return to my friends. I thought I had played it perfectly, but I found her later chatting up someone else. Clearly, if other guys are offering similar goods in terms of their looks and small talk, but are not playing hard to get, they are offering a better deal.

I realised that you can only play hard to get once the woman actually knows and likes you. This is because by then you have differentiated yourself from the other men on the market, so you gain more control over your market price. As you come to be seen as an individual with unique characteristics, rather than one of many men trying to get some attention in a club, the market structure changes from one of many competitors selling homogeneous goods to one of a handful of competitors. Playing hard to get is suited only to at least the second or third date, because only then is demand sufficiently inelastic for a woman to tolerate, or even be attracted by, a rise in price.

'When it comes to marketing ourselves, it looks as if playing hard to get is, in part, as for Rolex watches, an effort to maintain our status as luxury goods.' Photograph: Finn Taylor for the Guardian

A few months after Lizzie dumped me, I met Sarah: nice, fun, pretty. I mustered the courage to ask her out for a drink. The date went well. I sent her a message afterwards saying that I'd had a good time and would like to meet up again.

"Yeah, sure, sounds good," she replied. I could already tell she was playing this one cool. I learned from our mutual friends that she had no intention of getting into a relationship. OK, I thought, I know this game. Be cool, too, establish a monopoly, restrict your supply.

I liked Sarah. I found her attractive, and there was definitely some long-term potential. How was I supposed to communicate this to her without actually saying it?

Economically speaking, a signal is a visible cost incurred by an individual that reveals information about their preferences or what type of person they are. As most men are willing to part with their cash to impress a woman, spending money in itself is no way to reveal that you really like someone. Instead, a carefully considered choice of restaurant, perhaps one that shows some kind of link to something you discussed at your last meeting, is much more effective as a signal of genuine interest. Similarly, choosing a lunch date rather than a dinner date says, "I have no intention of trying it on with you, this time."

That said, evidence of too much planning can be an oversupply. Or, to put it another way, it can be just plain creepy. So you need a costly signal that can convey information about your preferences, without diminishing your market value. I got to work thinking about how I would follow up my first date keeping this trade‑off in mind.

It would be a lunch date in the park. We'd pick up a sandwich from a local deli and laze around on the grass, chatting. The plan was meant to signal I was happy to put the brakes on, as well as show I was interested in more.

The second date went well and, against all the odds, Sarah and I broke through the six-week barrier. Sarah seemed to like me for the complete package, for all my various imperfections as well as my good parts. Our relationship made my life better in practically all areas.

But as the months passed, Sarah's tolerance of my misdemeanours seemed to diminish. Soon I found that none of my various shortcomings – my messiness, my lateness – was going unnoticed. Life was becoming a bit of a drag, and I got to thinking about what else might be on offer.

Being with Sarah cost me time, money and emotional investment. It also cost me the things that I couldn't have because I was with her, such as nights out with my friends and the chance to meet other women. Those missed things are what are known, in economic terms, as opportunity costs. With these, we have to look at our spending decisions relative to what else is available to make sure we're getting the best deal for ourselves.

Now I just needed to apply this thinking to my predicament with Sarah. If I were to take Sarah in complete isolation, I would say I was happy. We were a great team, we had put a lot into the relationship and, though the returns on my investment were diminishing, we might still be able to get a lot more out of it. But when I looked at what I was missing out on, I wasn't so sure.

"I kind of feel that I've been growing apart from my friends recently," I said to Sarah. "Do you really want to look back on your 20s and regret all those things you didn't do?"

"So you're saying that you're going to regret being with me?"

"No! Don't be silly… I think we've had a great time so far."

"Yes, we have," she agreed. "I know things have been a bit rocky recently, but we've put so much into this…"

The words "We've put so much into this" struck a chord. Sarah, I realised, was making the same mistake I had made one night when I spent four whole hours queueing to get into a club. Each time I thought about leaving to find another club, or go home, I thought, "Well, I've already waited half an hour, so it would be a waste of my time if I left now." If I'd thought more like an economist, I'd have known to disregard the time I had already spent queueing. That time had been and gone; it was a sunk cost. What I should have asked was, "What do I want to be doing right now?"

In the same way, my attachment to the time that Sarah and I had already spent together, and the bond that had formed between us as a result, shouldn't cloud the fact that what I was missing could make me happier. I needed to stop asking, "Given that I am in a relationship with Sarah, what reason do I have to break up with her?" and ask instead, "Given that I am in a relationship and could be in another relationship, or none at all, what reason do I have to stay with her?"

Two nice, compromising people could stay together indefinitely if they continued to ask the former question rather than the latter. They would trundle along together, amicably, for their whole lives. And yet they could still be missing something, and be completely oblivious to it. I wasn't going to be one of those people. I was only in my 20s. The time for me to say "You'll do" was still a long way off. It was time to liquidate my investment and buy back into the market.

When I started dating again, I soon realised something in me had changed. Perhaps Hobbes wasn't the best model to go by after all. I'd become so concerned that I wouldn't get back from a relationship at least as much as I put in that I put in a little, and ended up getting nothing back. Being completely self-interested, I realised, was not just morally dubious but economically inefficient.

And so I started to think like a Keynesian. Keynesians don't believe that balancing a budget is the immediate solution to economic malaise. Keynesian governments try to restore the thing that badly performing economies are generally lacking: confidence. They do this by borrowing money and spending it on public projects, which create jobs, which in turn increases consumption, which creates more jobs. This upwards spiral of investment, production and consumption is known as the Keynesian Multiplier. If the multiplier works, the government can actually get back more from the taxpayer than it originally spent, as the rest of the economy increases production and with it the tax it pays.

When I met Rosie, I changed my strategy. We reached the familiar third-date impasse, and I could tell Rosie was on the defensive. But instead of playing along, settling into my defensive mode and waiting for her to budge, I decided to be open. I said, in as many words, "I like you. I want to spend more time with you."

Over the ensuing weeks I gave, in many ways, more than I could ever, rationally, have expected to get back from her. Getting back as much as I put in wasn't really the point. I just wanted to make her happy. And the more I gave, the more Rosie showed to me the person she really was. We fell for each other. I was no longer happy just because I liked the idea of making her happy, but because I was getting to know the real Rosie. The multiplier effect had kicked in: knowing that I was in some way responsible for the flowering of the person in front of me made me want to give her even more, and she, in turn, gave more back. We became more than the sum of our parts.

Keynesian economics and love, it turns out, have rather a lot in common: they both work not by balancing budgets, or reducing supply to increase prices, but by inspiring trust. Economics did, in the end, provide me with an answer – just not the one I expected.

• This is an edited extract from The Romantic Economist: A Story Of Love And Market Forces, by William Nicolson, published by Short Books at £12.99. To order a copy for £9.60, including UK mainland p&p, go to guardian.co.uk/bookshop.