The Mad Man is a literary novel by Samuel R. Delany, first published in 1994 by Richard Kasak. In a disclaimer that appears at the beginning of the book, Delany describes it as a "pornotopic fantasy". It was originally published in 1994, republished and slightly revised in 1996, and republished again with significant changes in 2002  and again in an e-book version with further corrections in 2015. Delany considers the 2015 version the definitive edition.
 In New York City in the early 1980s, a black gay philosophy graduate student, John Marr, is researching a dissertation on Timothy Hasler, a Korean-American philosopher and academic stabbed to death under unexplained circumstances outside a gay bar in 1973. As details emerge, Marr finds his lifestyle converging with that of Hasler, and he becomes increasingly involved in intense sexual encounters with homeless men, despite his growing awareness of the risks of HIV. In the course of unravelling the mystery of Hasler's death, Marr joins with a homeless man from West Virginia, who goes by the street name "Leaky." Scenes based on letters Delany actually wrote (see: 1984: Selected Letters) take place in a gay bar in New York, though the basic incident is fictional.
 The Mad Man, spanning 501 pages in its first hardcover edition, is Delany's longest and most ambitious novel since Dhalgren (1975). As such, it combines a number of perspectives: a realistic portrayal of academic research, New York street life and both pre- and post-HIV gay activity, as well as explicit portrayals of fellatio, coprophilia, urophilia, and mysophilia. It also contains magic realist elements, such as the bull-like monster that appears in Marr's nightmares. Also, it employs autobiographical elements from Delany's life, having to do with his more recent life as an academic. The relationship between the intellectual Marr and a street person, Leaky Sowps, mirrors those in many of his previous novels, as well as his real-life partnership of 17 years (as of 2007) with Dennis Rickett, formerly homeless for six years, before they met. Scenes in The Mad Man occur during "wet night" at the Mineshaft, a gay bar that actually existed in New York's meat-packing district in the '70s and '80s and indeed held such a monthly event. Other scenes detail visits to the pornographic movie theaters in the 42nd Street area, where much gay activity occurred from the sixties until they were shut down in the mid-nineties. Marr writes letters to friends containing passages that are verbatim transcripts of actual letters Delany wrote at the time; some of the originals are collected in his 1984: Selected Letters (Voyant, 2000). As such, the novel has great value as a gay history of the passage between the seventies and nineties in New York, as well as portrayals of the complex and changing attitudes towards AIDS by sexually active gay men over those years.
 All three editions conclude with the article "Risk Factors for Seroconversion to Human Immunodeficiency Virus Among Male Homosexuals," by Kingsley, Kaslo, and Renaldo et alia, as published in the Lancet, Saturday, 14 February 1987, which statistically supports the theory that AIDS cannot be transmitted orally. This supports both the plot of the book and why Delany himself remained HIV-negative.
 Delany said that the novel was inspired by his outrage at an article on AIDS by Harold Brodkey that appeared in The New Yorker in the June 21, 1993 issue. (Brodkey's series of articles about dying of AIDS was reprinted in revised form as a book, This Wild Darkness: The Story of My Death (Henry Holt and Company, 1996)). The article entitled "To My Readers" begins, "I have AIDS. I am surprised that I do. I have not been exposed since the nineteen-seventies, which is to say that my experiences, my adventures with homosexuality took place largely in the nineteen-sixties, and back then I relied on time and abstinence to indicate  my degree of freedom from infection and to protect others and myself." Once past its "Proem," Delany's novel opens with similar statements, but placed in the negative: "I do not have AIDS. I'm surprised that I don't . . ." As critic Reed Woodhouse (in Unlimited Embrace: A Canon of Gay Fiction, 1945—1995, University of Massachusetts Press, 1998), wrote, "What one hears in Delany's sentence is the sound of the gauntlet being thrown down, for he wants to completely reverse the story Brodkey tells: the story, that is, of an 'innocent victim' who may have played around a little but very long ago and certainly not doing those things. John Marr, by contrast, is presented as a 'guilty victor', so to speak, in that he has done all those things (though not, it is true, unprotected anal intercourse) and has yet survived."
 The character of Timothy Hasler is based in part on the philosopher Richard Montague. Unlike Montague, who was strangled, he dies in a knife fight in a bar at age 29. Montague was murdered in his own home at the age of 40 in Los Angeles, though it was almost certainly from a sexual partner or partners he brought home from a bar.
 The chimeric creature from Marr's nightmares makes its first appearance here in Delany's body of work. It appears on the cover of Phallos and a statue modeled after it appears in Through the Valley of the Nest of Spiders.
 Marr collaborates with a "well-known" science fiction writer named Aranlyde, who is described as having "some particular cachet among more intellectual SF readers". A character "Muels Aranlyde" appears in Delany's Empire Star; the name is an anagram of "Samuel R. Delany".
 Delany discusses some of the background behind the novel in "The Phil Leggiere Interview: Reading The Mad Man", which appears in his essay collection Shorter Views.