Image copyright Alex Goodier Image caption Alex Goodier and her trainer, Darren Fuller

More and more middle-aged women are signing up to do triathlons. Alex Goodier is one of them. She was the last of 5,000 competitors when she crossed the finish line at this year's Blenheim Palace triathlon, despite being diagnosed with fibromyalgia during training.

Eighteen months ago, Alex Goodier says she was 14 stone overweight and decided to do something about it. After her colleagues gave her a mountain bike she found a personal trainer, Darren Fuller, and set about losing three stone.

Then she signed up for a triathlon, which her company, The Access Group, enters every year. She originally planned to cycle as part of a team, but on an outing with her colleagues, fortified by wine, she entered the full "sprint" distance - a 750m swim, 19.8km bike and 5.4km run.

Triathlon was not an obvious choice. "I had not ridden a bike since the age of nine - turns out you can forget," she says. "I am petrified of open water, black water, and I'm not a strong swimmer."

Open-water swimming is challenging for most first-timers, says Beate Vogt from Tri50, who specialise in training women and the over-50s. Vogt says people tend to come to triathlons from another sport - often running - when they're slowing down or need a new challenge. "It's a funny time of your life when you want to know about yourself," she says. "Often your children are older, and you have a little more time."

Image copyright Marathon Photos

Goodier began training by running from lamp post to lamp post - a 20-second run, followed by a 40-second rest. But she kept "crashing" - she would faint, collapse and be unable to see or hear.

She had been given a diagnosis of systemic lupus at the age of 21, but had told the doctor to "get stuffed" and carried on with her life regardless. After her problems in training, Fuller persuaded her to go to the doctor, where she was told she had "rip-roaring fibromyalgia".

Fibromyalgia is a chronic condition that causes extreme fatigue, pain and weight gain. "Sometimes I am too tired to sit in a chair," says Goodier. Any kind of pressure causes extreme pain. "On a scale of 0=good and 10= flat on my back with pain, the training came in at about 8."

Still, she carried on. A month before the race she practised half the distance, which took four-and-a-half hours. Then, to her horror, she discovered there was a time-limit - all competitors had to reach the last section by 16:55 or be disqualified - and her race began at 12:50.

It seemed impossible, on past performance she was bound to fail - a year's training would be wasted. "I cried for a day," she says.

The day of the race brought another shock - transitions. These are the bits in between the various stages, when participants have to wrestle out of a wetsuit - in public - to get on to their bike, and later, park the bike and run.

Just getting from the lake to the bike-racks involved running 100m up a steep grass incline, barefoot, dodging little rocks. "Now, I was really starting to get petrified," says Goodier.

Image copyright Blenheim Palace Triathlon

The race began on a floating pontoon from which contestants had to jump into the water. Goodier jumped and went down - a long way down. "By the time I got to the top I was hysterical - which is bonkers, because I float," she says. Four stewards came to her rescue, but when Fuller swam over and said "do you trust me?" she calmed down.

The race organisers assigned Goodier a steward canoe and directed her around the outside of the course, away from the scramble of other swimmers. It took her just under an hour to swim the 700m distance.

Fuller stayed with her all the way, but his wetsuit provided less cover and by the end his teeth were chattering and his hands had turned blue. The paramedic who helped them both recover when they got out asked: "Why are you doing a triathlon?" It was not a good time to ask that question.

Image copyright Beate Vogt Image caption Beate Vogt specialises in training the over-50s

Next came the bike ride. After stuffing down a protein bar and jelly beans, Goodier walked up the hills and rode, screaming, all the way down. Fuller reminded her to stay strong. "Too late," she replied.

Sobbing and suffering from cramp, she was about to give up, when she passed the company tent. "They saw me coming and started screaming my name - I was not prepared for that," she says. It motivated her to carry on for another two laps.

Finally, dizzy and in pain, Goodier began the 5km run - or power-walk, in her case. By now, Fuller had serious concerns - they had been going for a few hours, and it looked like they were going to miss the cut-off time by minutes. To their huge relief, on the last stretch they saw that the course was still open.

Fuller put a marker 30m before the finish so Goodier could end on a run, which she did. "The finish was fantastic, everyone went crazy," she says. "All I could do was bend over and try to breathe."

It had taken her nearly five hours to complete the course. After the exhilaration, there was a heavy price to pay - total exhaustion, flare-ups and raging fevers. "The aftermath was no fun. I couldn't lift a cup," she says. But she wanted to tell her story because, "when you are diagnosed with a condition like fibromyalgia, people give up - and nothing makes you sicker faster."

A survey by the UK Triathlon association found that 76% of first-time triathletes want to carry on with the sport. Goodier isn't sure - it took her a month to fully recover - but she really enjoys running and has her eyes set on a half-marathon next autumn.

She is still trying to lose weight, although the fibromyalgia makes it harder. By the time of the triathlon she had lost more than five stone and she wants to lose much more.

She still marvels at how, on the day of the race, there wasn't one instance of negativity. "I was dumb-founded by how I was cheered on by everybody."

Image copyright Marathon Photos

Midlife triathletes

•The average triathlete in the UK is 41 years old - overall, 40-44 is the largest age group, with 20% of all triathletes

•The overall male-female ratio is 72:28, but for first-timers, the male-female ratio is 67:33

•The total UK triathlon market is estimated at £363m in 2014 - 60% of revenue came from events, bikes and bike-related spend

•54% of triathletes were runners before they took on triathlons - having a balance across multiple sports can help those battling single-sport injuries

Data from MultiSport Research / UK Triathlon Industry Association (TIA)

Subscribe to the BBC News Magazine's email newsletter to get articles sent to your inbox.