On Wednesday, I wrapped up the class I’ve been teaching all semester: “The Great Recession: Causes and Consequences.” (Slides for the lectures are available via my blog.) And while teaching the course was fun, I found myself turning at the end to an agonizing question: Why, at the moment it was most needed and could have done the most good, did economics fail?

I don’t mean that economics was useless to policy makers. On the contrary, the discipline has had a lot to offer. While it’s true that few economists saw the crisis coming — mainly, I’d argue, because few realized how fragile our deregulated financial system had become, and how vulnerable debt-burdened families were to a plunge in housing prices — the clean little secret of recent years is that, since the fall of Lehman Brothers, basic textbook macroeconomics has performed very well.

But policy makers and politicians have ignored both the textbooks and the lessons of history. And the result has been a vast economic and human catastrophe, with trillions of dollars of productive potential squandered and millions of families placed in dire straits for no good reason.

In what sense did economics work well? Economists who took their own textbooks seriously quickly diagnosed the nature of our economic malaise: We were suffering from inadequate demand. The financial crisis and the housing bust created an environment in which everyone was trying to spend less, but my spending is your income and your spending is my income, so when everyone tries to cut spending at the same time the result is an overall decline in incomes and a depressed economy. And we know (or should know) that depressed economies behave quite differently from economies that are at or near full employment.