William Baumol, an American economist, died May 4, at his home in New York City. He was 95. (NYU Stern School of Business)

William J. Baumol, an economist who explained why the cost of college, an annual physical and a night at the symphony will outpace inflation — and why we need not throw up our arms in despair, died May 4 at his home in New York City. He was 95.

His son, Daniel Baumol, confirmed his death and said he did not know the cause.

A preeminent economist of his generation, Dr. Baumol taught for more than 40 years at Princeton University and at New York University, where he retired in 2014. His work touched on monetary policy, corporate finance, welfare economics, resource allocation and entre­pre­neur­ship, but he was best known for the principle that came to bear his name: Baumol’s cost disease.

The insight came to him in a 4 a.m. epiphany in the 1960s, when he and a colleague, future Princeton president William G. Bowen, were preparing an analysis of the cost of presenting and attending the performing arts.

“I suddenly woke up and said I know why those costs are going up!” Dr. Baumol recalled in a 2001 oral history with economist Alan B. Krueger. “I got up, wrote down a few notes, and went to sleep again. That’s literally how it happened.”

Distilled to its essence, Baumol’s cost disease is the idea that personally delivered services — musical performances, medical care, education and garbage collection, for example — naturally and inevitably increase in price year after year. “The idea is really trivial,” Dr. Baumol said. “But the implication, which I think has not been yet learned, I think is mind-boggling.”

The result of the cost disease, Princeton professor Alan S. Blinder said in an interview, is that services will be “more and more expensive relative to either goods — things you buy in the store, like bagels or cars,” or automated services such as the Internet.

Improved technology may allow bagels and cars to be produced more efficiently and therefore more cost effectively, but, as Dr. Baumol famously observed, a Mozart string quartet requires today the services of four musicians, the same manpower it took in the 18th century. “Productivity improvement of zero,” Blinder said.

Over the years doctors have managed to see more patients in less time by eliminating house calls, but even office visits require a certain minimum amount of time. Schools might increase efficiency by growing class sizes, but few if any parents would regard such a change as an improvement in quality.

Well-appointed garbage trucks might speed collection time, but still they must stop at every house. Police and fire departments similarly require certain base levels of staffing if they are to provide their promised services.

Dr. Baumol’s ideas had immediate relevance in public policy, particularly in the areas of health care and education, where “all kinds of villains have been trotted out,” Blinder said — “local government, teacher unions, rapacious health care providers.”

“You have now explained to me why the Democratic Party is called the party of tax and spend,” the late U.S. Sen. Daniel Patrick Moynihan (D-N.Y.) once told Dr. Baumol, “because we are financing all the things that are affected by the cost disease.”

Dr. Baumol advised then-first lady Hillary Clinton on the Clinton administration’s failed health care plan in the early 1990s. He declared his support for the Affordable Care Act signed by President Barack Obama in 2010, and which House Republicans voted on May 4 to significantly curtail.

Dr. Baumol cautioned supporters of Obama’s program not to promise more than they could deliver, given the incurable nature of the cost disease. At the same time, he argued that savings in sectors outside health care and education would allow future generations to spend a greater percentage of their income on those services.

“The critical point here is that because politicians do not understand the mechanism and nature of the cost disease, and because they face political pressures from a similarly uninformed electorate, they do not realize that w e can indeed afford these services without forcing society to undergo unnecessary cuts, restrictions and other forms of deprivation,” he wrote in his 2012 book “The Cost Disease.”

William Jack Baumol, a son of Eastern European immigrants, was born in the Bronx on Feb. 26, 1922. His father, a former bookbinder, ran a laundromat in New York. Dr. Baumol described the household as “left-wing” and said he became interested in economics during high school by reading the works of Karl Marx.

He studied economics and art at the College of the City of New York, where he received a bachelor’s degree in 1942. After Army service during World War II, he received a PhD from the London School of Economics and Political Science in 1949.

As an academician, he seemed to challenge his eponymous cost disease with his productivity. He published hundreds of articles and several dozen books, among them the now-classic textbook “Economics: Principles and Policy,” which he co-wrote with Blinder, a former student.

Burton Malkiel, a professor emeritus of economics at Princeton and a former thesis advisee of Dr. Baumol’s, described him as an “extraordinary mentor to I would say not just one generation but generations of students.”

Survivors include his wife of 75 years, the former Hilda Missel, of New York City; two children, Daniel Baumol of New York City and Jasmine Wolf of Coventry, Conn.; and two grandchildren.

Dr. Baumol said that he relished drawing abstractions from economic curiosities that he observed at work in the world.

“Sometimes, I’m lucky; the abstraction turns out to be useful,” he remarked. “And sometimes, I’m very lucky, and I turn out to be totally wrong. Because when I turn out to be totally wrong, that’s when the best ideas come out. Because if my intuition was right, it’s almost always going to be fairly simple and straightforward. When my intuition turns out to be wrong, then there is something less obvious to explain. Of course, I’m always depressed when I turn out to be wrong, but for a short while only.”