Industrial production is rising. Inventories are growing. Unemployment is slowly declining. At long last, the worst recession in more than 40 years appears to be over.

But the banking industry--which swilled a recession potion laced with a massive dose of its own mistakes--has a financial hangover that is unlikely to go away for years:

* Big banks, as well as many medium-sized regional banks, have tens of billions of dollars in loans to lesser developed countries that are over their head in debts and having problems repaying.

* Many small and medium-sized banks--as well as a few giants like Continental Illinois--made too many energy loans and are left holding shaky loans to oil drillers and oil service companies.

* Loan demand is down sharply, as it usually is at the beginning of a recovery, but interest rates are on the rise again. If rates stay up--and no one knows whether the recent rise is ephemeral--they will put a terrific squeeze on earnings at a time banks need higher profits to make provisions for escalating loan losses. Banks will pay more for their deposits while competition will keep down the rates they can charge business borrowers. Some experts say that the banks' best bet is the consumer borrower, but that to attract consumers banks will have to lower rates.

The severe recession took a terrific toll on most of the economy, leaving many shaky loans to individual companies even in industries that are recovering today.

"During the 1974-75 recession, the major casualties were the real estate investment trusts , tanker ships, New York City and W. T. Grant, a major retailer. But in 1981-82, the list of ailing groups included thrift institutions, airlines, agriculture, oil and gas, nuclear power, housing, small businesses, less developed countries, forest products and state and local governments," according to C. T. Conover, the comptroller of the currency, who regulates the nation's federally chartered banks.

James Wooden, chief banking analyst at the brokerage firm Merrill Lynch, Pierce, Fenner & Smith, said the quality of assets--both domestic and international loans--is the biggest difficulty confronting banks. Banks have to worry about the health of many of the companies and nations that are current borrowers.

At the same time, because they are awash in deposits--the new money market deposit accounts have swelled bank coffers--they must find new, high quality borrowers even though corporate loan demand is weak.

Problem loans are increasing at most of the nation's 14,000 banks--especially among the big money center banks and energy lenders in the Southwest. Nationwide, banks are failing at the rate of one a week. About 450 banks are classified as problem institutions that need special supervision by the regulators. Most of those merely have a higher concentration of risky loans than the regulators like. But some are on the brink of insolvency or are being kept afloat while regulators try to find healthy banks to merge with or buy them.

Even though the economy as a whole may be getting better, it may not improve fast enough to save a host of companies that managed to hang on through the recession. That is why regulators like Conover anticipate "further increases in both problem banks and bank failures this year and perhaps next year."

No one anticipates a collapse of the banking system. The vast majority of banks will earn enough from their good loans to cover losses on the bad ones. The banks with the biggest exposure in foreign lending are big enough to ride out the storm, barring an international collapse.

Most of the banks that are truly in trouble are small and their failures will generate few shock waves. Those in difficulty that are sizeable--with assets of more than $500 million--will be merged with other banks, although the Federal Deposit Insurance Corp. undoubtedly will bear some of the costs of those failures, as it has been doing.

The large loans to troubled developing countries like Mexico, Brazil and Argentina have generated the most concern about the health of the nation's banks, and rightly so, according to Lawrence Fuller, who analyzes the banking industry for the brokerage firm Drexel Burnham Lambert Inc.

The difficulty many of these countries are having in repaying their borrowings--and the need for coordinated effort among the world's bankers, governments and the International Monetary Fund to bail the nations out--has "shown that this foreign lending is a riskier business than we thought," according to Merrill Lynch's Wooden.

But it is a problem that is amenable to solution--provided the world economy revives fast enough to increase the exporting ability of the financially troubled countries and the banks are willing to continue to makes loans to these countries. Rimmer DeVries, chief international economist for Morgan Guaranty Trust Co., estimates that banks will have to increase their loans by 7 percent a year to enable the debt-ridden developing countries to service their debt.

It is mostly large banks that have substantial loans to debt-laden Latin American nations. Although any one of those banks would be seriously damaged by a major default--a possibility most analysts consider remote--the resources these giant banks have at their disposal probably would enable them to survive.

On the other hand, according to an official of one large New York bank, problem loans in the energy industry is the hidden story in banking today. "Many of the problems won't surface until 1984 and 1985," he said, when the once-profitable drilling companies and oil service companies run out of cash and are unable to continue to pay.

The problems may spread to natural gas producers as well. Many smaller producers, who borrowed heavily, see their cash flows diminishing sharply, and like many oil drilling and service companies, will find it hard to repay their loans.

The shaky energy loans are held by many small and medium-sized banks--especially those in the West and Southwest, where much of the exploration, drilling and production occurs.

Penn Square National Bank, whose failure last July sent shock waves through the banking industry, was a major lender to oil drillers and oil service companies. Penn Square was a relatively new bank that grew rapidly by making oil loans. Many of its loans were made to poorly capitalized companies that were early victims to the sudden downturn in the Texas and Oklahoma oil economy.

With the recession in the oil lands continuing, many other energy banks and their customers are still to feel the impact.

"It's strange to think, isn't it, that Texas may be the weak link in the U.S. banking system?" remarked one top bank regulatory official.

Because of the seriousness of the recession, there are many links that are strained, observes Albert R. Gamper Jr., senior vice president in charge of corporate planning for Manufacturers Hanover Trust Co. "It's a cross-section of the economy," Gamper said of the trouble spots. He noted there is a long list of major companies that have gone bankrupt: Wickes Cos., a major retailer; NuCorp, a major energy company; Braniff, a major airline.

A number of other major companies remain on the ropes, including International Harvester, Tiger International, and Pan American, although the recent surge in airline travel is a godsend for Pan Am, analysts said. The failure of these companies would add to the strain on their bankers.

In addition, in many major cities there is a glut of new office buildings that have been financed by banks but so far not occupied by tenants.

If the banking industry has an overload of nonperforming assets, it also has a potload of cash to lend or otherwise invest. Money market deposit accounts, authorized by federal regulators last December to enable financial institutions to compete with money market mutual funds, have attracted tens of billions of new dollars.

Drexel Burnham's Fuller said the only large market open to banks in the near future is the consumer. Commercial and industrial loans will be flat or declining for the next year or more--as most companies seek to replace short-term bank debt with long-term bonds and need to borrow less because their cash flow improves in a recovery.

Banks will make as few international loans as they can. Commercial real estate lending also will decline.

"Banks have been reluctant to lower consumer interest rates too much," Fuller said. At the current level, he said, consumer loans return a very high margin, an important consideration for bank officials trying to maximize income at a time when more and more loans are going sour.

"But if they're going to get profits growing, they've got to get new loan business," Fuller said.

Consumers, however, are very sensitive to rates. The automobile companies, which have been offering rates as low as 8.8 percent on new car loans, have cut the banks out of the auto market.

"They've got to cut consumer loan rates," Fuller said.

Like all interest rates, consumer rates have come down in the last year, although not as fast as other rates. But a big cut in consumer loan rates will be bitterly resisted by many banks, especially larger ones. Many banks have spent the last five years trying to acclimate consumers to paying higher rates. Many banks have moved their credit card operations to South Dakota or Delaware to avoid usury laws in their home states.

But one banker noted the consumer will be a strong, good borrower if the banks go after the business. "We can't sit around and wait for corporations. We don't want to boost international lending too much. For the next six months to a year, the consumer should be our best customer."