On October 18, 2014, the ballerina Wendy Whelan took her final bow as a principal dancer with the New York City Ballet, the company to which she belonged for three decades. She was 47 years old at the time—and, as she told the New York Times that year, “In ballet, if you’re over 40, you’re a dinosaur." She had recently been sidelined by a hip injury, and she was only just recovering. Thirty years in, and still just beginning to feel the physical effects of aging, Whelan decided it was time to retire from ballet.

The new documentary Restless Creature: Wendy Whelan, directed by Linda Saffire and Adam Schlesinger, follows Whelan from mid-2013, when she began to be plagued by hip pain, to her farewell performance, charting the uncertainty, instability, and doubt Whelan confronted while grappling with the end of her career as a ballerina, and what comes next. It’s a revealing, at times raw, examination of Whelan’s final year with the City Ballet, the genesis of her career, and her profound impact on the dancers around her.

That impact cannot be overstated: In one scene, Whelan, whose talent was singular, rehearses as a cadre of young dancers cluster in the doorway to watch; in another, pre-teen ballerinas pose for photos with Whelan after class. A week before her retirement, Marina Harss saw Whelan dance Christopher Wheeldon’s “After the Rain” and wrote in the New Yorker, “How will anyone dance this after Whelan?” (Whelan originated the role in 2005 alongside Jock Soto.)

Restless Creature also examines what comes after ballet: Whelan had just begun working on a new contemporary work, the titular “Restless Creature,” when one of the project’s sponsors suggested she document the process. Whelan was resistant at first; her hip issue, as she explains in the documentary, was the first major pain of her career, and she was unsure of her prognosis. And if she weren’t to recover, what—or who—would she be without ballet? But at the behest of that sponsor, she agreed to one day of filming. And then another. And then, they were making a documentary—and her uncertain future is where the drama lies.

“I started to realize that most ballerinas don’t expose this part of their career, and I thought I wanted to be brave,” Whelan told me on a recent afternoon in New York. As the camera trailed her from rehearsals to meetings with friends, peers, mentors, and even into the operating room, Whelan decided to leave the ballet. It turned out, the documentary helped her focus the “torment and tumultuousness,” she said. “Being able to put all that confusion and difficulty into a creative act was huge for me in getting through it.”

“It helped me voice my feelings; it helped me express; it helped me get something from it,” she continued. Whelan speaks dramatically, emoting as if for stage, punctuating each very—voice, express, get—with a gesture. “Which was huge—which gave me, ultimately, empowerment.”

The documentary captures Whelan’s relentless optimism—that she will continue to dance—as well as her toughest setbacks, including a few tiffs with doctors and physical therapists. In one scene, she meets with Peter Martins, the longtime ballet master for the City Ballet; he takes her out of The Nutcracker, in which she had danced the role of the Sugar Plum Fairy for 22 seasons. For Whelan, it was a stark sign of her decline, and a bitter pill: “It wasn’t that I loved to do that ballet—I didn’t,” she said, dryly. “Because it is so formative, to be removed from that ballet of all ballets was just that much more profound.”

Nearly every girl with an interest in dance has an early Nutcracker memory. I saw the City Ballet’s staging, probably with Whelan herself, with my mother and sister when I was young. Whelan, too, had a nostalgic attachment to the role. When she was eight, she and her friend Liz planned to audition for a local Louisville Ballet-staged production of the Tchaikovsky ballet, its cast made up predominantly of adults. Whelan’s mother was skeptical, displaying the cautious pessimism of a parent reluctant to allow their child to fail: “Her first instinct was, ‘What if you don’t make it?’” Whelan recalled. “I said, ‘I’m gonna make it.’ So that’s when I was first confronted with, well, maybe you won’t be able to do what you want to do.” (Both girls made it; Whelan danced the role of one of the mice.)

Wendy Whelan and Craig Hall perform the world premiere of "By 2 With & From," choreographed for her farewell performance by Christopher Wheeldon and Alexei Ratmansky, with the New York City Ballet, October 2014.

Paul Kolnik

That persistence—bullishness, maybe—is on display in Restless Creature, which draws parallels between Whelan’s recent difficulty with her hip and her diagnosis, at age 12, with severe scoliosis that could have sidelined her before she even got to the City Ballet stage. She wore a corrective back brace to ballet classes for five years, eventually earning a spot as an apprentice at the New York City Ballet in 1984 and graduating to the corps in 1986. She became a principal dancer in 1991, where she remained until her retirement. Whelan came of age among a group of dancers just one generation removed from the company’s founder, George Balanchine, himself—she cited Nikolaj Hübbe, now of the Royal Danish Ballet, Peter Boal, now helming the Pacific Northwest Ballet, Jenifer Ringer at the Colburn School of Ballet; and Margaret Tracey of the Boston Ballet as “my people.” As depicted in the film, two of Whelan’s closest continuing collaborators were the choreographers Christopher Wheeldon and Alexei Ratmansky, who collaborated on a new work she premiered at her final performance.

With each successive generation, the company has distanced itself from and reinterpreted Balanchine’s legacy. There’s been a concomitant shift in the culture—especially, Whelan said, regarding social media. Dancers can sign lucrative endorsements, like Misty Copeland of the American Ballet Theater, who has said her contract with Under Armour earns her more than her ABT salary, or become muses of fashion houses, like Coco Lavine, also of ABT, who recently appeared in a Chanel video campaign alongside Ellie Bamber and others.

“I don’t think ballerinas back in the day were considered commercial in that way,” Whelan said. “Ballet needs that.”

Now, nearly three years have passed since Whelan departed the David H. Koch Theater stage. The end of Restless Creature hints at a national tour of the titular contemporary work, which Whelan postpones for additional hip surgery; after a year of touring and developing two new pieces, she eventually had the hip replaced entirely. And now?

“Pain free,” she declared.

Wendy Whelan takes a bow at her final performance with the New York City Ballet, October 2014.

Paul Kolnik

She has turned towards contemporary work, which she described as “more three dimensional” than ballet. Now an avid yogi, Whelan practices several times a week. And, earlier this month, Whelan traveled to Seattle to begin staging Ratmansky’s Pictures At An Exhibition, which debuted at the City Ballet during her final season with the company.

“I’m scared shitless,” she said. But not because she's staging a ballet that was her swan song, she assured me. “It’s theirs, and I want to do the right thing for them and for him,” she added, referring to Ratmansky.

Whelan doesn’t seem especially prone to nostalgia, anyways. At her retirement, a ballet teacher from her childhood approached her. “She said to me, ‘You’ve done so beautifully. Move forward, and don’t look back,’” Whelan said. “I don’t look back. And if I feel that little tinge sometimes, I just take a step and I work to…” She trailed off. “It’s easier, and easier, and easier.”

See an exclusive clip from Restless Creature: Wendy Whelan, out May 24: