General Motors Corp. Chairman Thomas A. Murphy predicted today that the current slump in automobile sales, which has caused the layoff of thousands of workers, should end soon.

He said that passenger car sales for the industry will be slightly less than the 10.5 million automobiles sold in 1979 but that "by the end of the year we'll be back on course."

Murphy told reporters after a speech to the Securities Industry Association meeting here that the nation's economic slump will be "short and shallow" and that the automobile industry could lead the economy out of the recession.

Many analysts, however, think that the recession will be longer and more difficult than either the perpetually optimistic GM chief executive or President Carter predict.

Although short-term interest rates are declining sharply now after months of record-high levels, many analysts expect them to rise again soon. High interest rates have hurt auto sales especially, both because buyers do not want to pay the high rates and because willing buyers in many cases cannot find loans due to state-imposed interest rate ceilings that make automobile loans unprofitable to banks and other lenders.

Robert J. Farrell, the top stock market analyst for Merrill Lynch, Pierce, Fenner & Smith, said in an interview today that the sharp fall in interest rates during the last month cannot be sustained. Since the middle of April short-term interest rates have fallen from about 18 percent to 11 percent or lower.

"All changes so violent generate compensating movement the other way," Farrell said.

Murphy, however, was more optimistic about the course of interest rates and the economy in general and said falling rates should help the beleaguered automobile industry.

By the summer, when the automobile industry generally changes over to production of the next year's models, there will be a shortage of cars on the retail market, Murphy said, a development that will bode well for production of 1981 models.

Twenty-five percent of all families have five or more persons in them" and need cars that seat more than two or four people, he said. "They do like to travel together and many families can afford only one vehicle."

Murphy said the nation's largest automaker intends to spend $38 billion on automobile research during the next five years and will spend $7 billion this year alone.

He said the auto giant does not plan any cutbacks in spending on research and development. Ford Motor Co., which lost hundreds of millions of dollars so far this year, said today it would trim $2.5 billion of its planned capital spending between now and 1984.

He said that Japanese producers, under pressure to set up plants in the United States because of their huge car sales here, are reluctant to do so in the large part because of the "host of restrictive government regulations, punitive tax laws, unrealistic environmental rulings and adversarial union-management relations that American manufacturers already labor under."