Ali Hazelwood accomplished an impressive feat: Her debut novel, “The Love Hypothesis,” was a constant presence on the New York Times bestseller list for over 40 weeks. Released in 2021, it was the first of her many books dubbed “STEMinist” romances, or love stories that feature a female lead who works in STEM.

The book gained traction for being a smart and steamy romance, and for the main characters bearing unmistakeable similarities to the leads of the “Star Wars” sequel trilogy, Kylo Ren and Rey (Hazelwood’s book started out as a fan fiction published online before getting picked up by a publisher).

Now, the author is publishing her fourth book, “Love, Theoretically.” The novel, set in Boston, centers around two rival physicists. By day, fictional Northeastern University alum Elsie Hannaway works tirelessly as an adjunct professor at Boston University, UMass Boston and Emerson College. By night, to supplement her meager paychecks, she moonlights as a fake girlfriend for clients who need a date.

Her double life comes to a head when Jack Smith, the physicist who ruined her mentor's career, is standing between Elsie getting her dream job at MIT. But, for these two physicists, the chemistry is palpable.

Hazelwood herself has lived a double life. She managed her career as a neuroscience professor while also writing novels under her pseudonym. But she is now taking a break from academia to focus on writing. Ahead of the release of “Love, Theoretically” on June 13, Hazelwood spoke with GBH News about the novel. Excerpts from the interview are below, and you can hear the full interview above.

Haley Lerner: Where did you first get the idea to write “Love, Theoretically”?

Ali Hazelwood: I really wanted to write a fake dating story in which the main character is fake dating, not the person that she ends up with, but someone else. It's a little bit of a twist on that trope. And then I also really wanted to write a story in which the main character is someone who sort of puts on a mask constantly, but there is this one person who was able to see through that mask and really see the kind of person she is.

Lerner: This book is set in Boston. What made you decide to set the novel in the city?

Hazelwood: The fact that there are so many institutions there, it was sort of a perfect city to set a story where someone is trying to move from an adjunct position — teaching a lot in several institutions — and moving to a tenure track position. I didn't do my doctorate in Boston, but my very first academic conference that I went to after moving to the U.S. for my Ph.D. was in Boston. It was the first time that I was traveling and I just thought it was amazing. I loved it so much. It kind of felt romantic to me in a way, to set the story in Boston.

Lerner: You write books about academia and women in STEM. Why do you think it's important to write romance that includes women working in these fields? And can you talk to the sexism in the fields, and how you address these challenges in your books?

Hazelwood: I am very much writing about my own experience, which is of a white woman in STEM. It's not an overall umbrella representation of everything that it is to be a woman in STEM.

It's very much a male-dominated field; STEM and academia can feel a little bit like an old boys club where there are certain unspoken rules and certain types of treatments of women. I do think it's been getting better and better, but there are still a lot of remnants of that kind of culture. When I started my Ph.D., I was the only woman in my cohort, and it felt kind of isolating.

Lerner: You have lived a bit of a double life like your main character, Elsie, being both a neuroscience professor and then working as a writer under your pseudonym Ali Hazelwood. How do you balance that double life?

Hazelwood: So the truth is that I have no idea how to balance it. I was really bad at it and that is why I've kind of taken a break from academia in the past year and I've been focusing on writing full time, because my executive functions are very lacking and I just couldn't really do both. I've been taking a year off now. My experience is that you can try to kind of hide something like this for a while, but in the end people end up finding out. Yeah, I failed miserably at keeping it a secret.

Lerner: You started out as a writer in the fan fiction community. How do you think writing in that format has influenced your writing style?

Hazelwood: The truth is that I didn't write before fan fiction. I never would have thought that fiction was something that was approachable to me before a fandom. I feel like everything I know about writing, I really learned from fan fiction.

I started writing very short stories, very canon-compliant stories, I would just take the characters and leave them in their own setting and maybe just write another adventure that they actually had gone to in one of their episodes. And then I moved toward writing longer stories in alternate universes, and I made the characters more mine.

If it weren't for fan fiction, I would have never written original books.

Lerner: Your success has blown up in the past few years and your books are huge on TikTok. Do you feel any pressure from it?

Hazelwood: I think last year was very hard because “The Love Hypothesis” came out in 2021. At the end of 2021, it was this big breakout book. Last year I was full of anxiety and I was like, “Oh my God, people aren’t going to like my other books and nothing is ever going to compare. I'm going to be at one hit wonder. This is the end.” I was just being very dramatic about it, but I really was full of anxiety.

I am not very anxious about it anymore and I think it's because I have completely cut myself off any sort of online basis so if people don't like the book, I will never know. And that is beautiful.