Written by Nick Glass, CNN

Money has never mattered that much to David Hockney , as long as he has enough to continue working. But equally, he's also always had a good memory for figures -- for the pounds, shillings and pence. As a student at London's Royal College of Art, he remembers selling a drawing to a friend and fellow student, the American painter Ron Kitaj, for a princely £5. It meant that he could buy cigarettes in packs of 20. He sold another early painting, "Adhesiveness" (1960), to photographer Cecil Beaton for £40. That meant he could begin planning to travel abroad.

As it happens, Hockney also has a clear memory of what "Portrait of an Artist (Pool with Two Figures)" originally fetched shortly after he painted it. On Thursday, at a Christie's auction in New York , the painting was sold for $90.3 million, an auction record for a living artist. But back in 1972, his New York dealer sold it for just $18,000.

"Portrait of an Artist (Pool with Two Figures)" (1972) by David Hockney Credit: Courtesy Christie's

For Hockney, the memory is still bittersweet. He felt ripped off. Last year, at his studio in the Hollywood Hills, he told CNN, "I thought it was a lot of money at the time, but within six months, it was sold again for $50,000."

After the sale, Hockney's American dealer, Andre Emmerich, "realized the pictures (in the show) were underpriced. A lot had been underpriced." But by then, it was too late. And so, as is often the case in the art market, someone other than the artist made a swift and substantial profit.

Hockney at 80: An encounter with the artist

More is known about the creation of "Portrait of an Artist (Pool with Two Figures)" than virtually any other single Hockney painting. The 1974 biopic "A Bigger Splash" chronicled its creation, and Hockney himself wrote about the painting in detail in 1988's "David Hockney by David Hockney: My Early Years."

"A Bigger Splash" was shot from 1971 to 1973 by British director Jack Hazan, who was given special access to Hockney, then living and working in London's Notting Hill, and his inner circle. A mix of fact and fiction, it centers on the painful unraveling of Hockney's five-year relationship with a young American artist, Peter Schlesinger.

Hockney told CNN the painting was inspired by an accidental juxtaposition of "two photographs on my studio floor, one of the Peter and another of a swimmer, and they were just lying there and I put them together." In his 1988 memoir, "David Hockney by David Hockney: My Early Years," he wrote: "The idea of painting two figures in different styles appealed so much that I began the painting immediately."

He worked on the picture for six solid months. The standing figure was always Peter Schlesinger. According to his official biographer, Christopher Simon Sykes, Hockney painted the swimmer first but then coated the canvas with a preparatory gesso, which prevented him from altering the position of the pool or the standing figure. It was a mistake.

Hockney gradually realized the painting -- in particular, the angle of the swimming pool -- just wasn't right. He wrote that, "The figures never related to one another nor to the background. I changed the setting constantly from distant mountains to a claustrophobic wall and back again to mountains. I even tried a glass wall."

David Hockney in his Hollywood Hills studio in 2017.

Realizing the futility of his efforts, Hockney abandoned that effort and, reinvigorated, started the painting all over again. He chose a new setting, a pool by a house in the south of France that belonged to British film director Tony Richardson. He took two models with him: a photographer named John St. Clair and Mo McDermott, his studio assistant.

He took hundreds of photos of the two. St. Clair, the submerged swimmer, dived into the pool in his white briefs so many times that he eventually cracked his head on the bottom and had to stop. McDermott acted as Schlesinger's stand-in, wearing his reddish pink jacket by the pool. Back in London, Hockney persuaded Schlesinger to pose for him early one morning in Hyde Park for yet more photos.

Peter Schlesinger and artist David Hockney standing in front of a photograph of themselves at a 1969 exhibition in London. Credit: Patrick Lichfield/Conde Nast Collection Editorial

Once back at his Notting Hill studio, Hockney painted for 18 hours a day on a canvas seven feet by 10. At one point, Hockney is filmed taking a Polaroid of the unfinished painting. At another moment, he paints in Schlesinger's brown hair with a long brush. "I must admit that I loved working on that picture, working with such intensity," he later told biographer Sykes. "It was marvelous doing it, really thrilling."

While he spent six months of the first version, the final "Portrait of an Artist (Pool with Two Figures)" was finished in just two weeks, to meet a deadline for a New York show in May 1972. In "A Bigger Splash," Hockney, with his trademark bleached blond hair and black, owlish spectacles, stands in bright red braces and a bow tie, carefully checking out how the painting was hung and lit in the show. It was the star exhibit, perhaps an expression of Hockney's personal loss and his acceptance that his long affair with Schlesinger was finally over.

Why is art so expensive?

But as we now know, all this wasn't without a sense of Hockney feeling cheated by what happened next. An American, apparently alerted by a British dealer, just came in off the street and bought it. The dealer then promptly took it to an art fair in Germany and sold it to a London collector for nearly three times the price. As he wrote in "My Early Years": "Within a year people had made far more on that picture than Kasmin (John Kasmin, his London dealer), Andre (Emmerich, his New York dealer) or I had. Considering the effort and trouble and everything that had gone into it, it seemed such a cheap thing to do."

We can only imagine how Hockney will feel after this sale, when the painting he worked so hard on has sold for more than 5,000 times its original price. The current seller and the auction house will no doubt profit, but, as a Christie's spokesperson confirmed, "the artist will not be financially benefiting."

Christie's hasn't named the seller, but he's believed to be British businessman Joe Lewis, who has famously collected postwar British art for some time.

At 81, Lewis happens to be the same age as Hockney. He also has a net worth of $5 billion.