For the first time in three years, the domestic auto industry Friday will close the books on a profitable year, with 1982's results expected to top $500 million, auto industry analysts said today.

However, the profits don't come from booming sales of cars and trucks in the United States. They come from payroll slashing, including more than 269,000 U.S. autoworkers on indefinite layoff, income tax credits, healthy subsidiaries and streamlined factory practices at the four major U.S. automakers.

U.S. car sales in 1982 were an estimated 5.7 million, off about 8 percent from the already dismal level of 6.2 million in 1981.

Meanwhile, U.S. and Canadian automobile production for 1982 reached an estimated combined total of 5,863,030, or 16.7 percent below 1981's "build" of 7,034,680, officials said yesterday.

Projected domestic production of 5,077,304 for the year had been the lowest since 1958. Canadian production of 785,726 was the lowest since 1967, Ward's Automotive Reports Magazine reported. Truck output was put at 2,360,473 for the two countries, 8 percent ahead of production of 2,186,600 in 1981.

The last time the U.S. auto industry had a profitable year, in 1979 when the four major companies earned $3.03 billion, U.S. car sales totaled 8.3 million. Sales have been on a downward slide ever since, and the automakers lost $5.5 billion from 1980 through 1981.

In 1982, General Motors Corp. and Chrysler Corp. will be in the black while Ford Motor Co. and American Motors Corp. will be in red, analysts said.

U.S. automakers "have cut their breakeven points drastically," said John Hammond, analyst at Data Resources Inc. in Lexington, Mass. "They have done more than any other industry because they have had the problems" of a sluggish economy longer.

David Healy, analyst at Drexel Burnham Lambert Inc. in New York, said this year's results are "significant."

He added, "Next year will bring a large improvement in profits and sales" for the automakers because of a slight but growing upturn in sales and the efficiencies and payroll cuts that are in place.

So far in 1982, the major automakers have combined profits of $510.8 million.

Analysts said they expect GM, with profits of $817.7 million for the first nine months of 1982, to end the year with a profit of near $1 billion. GM would earn at least $110 million and possibly more than $150 million for the fourth quarter, they said.

GM earned just $333 million in 1981 compared with $2.89 billion in 1979. Results for 1982 will be helped by record earnings for its finance and insurance subsidiary, General Motors Acceptance Corp., and income tax credits.

Ford, the most troubled automaker this year in earnings, will be in the red for both the last quarter and the year, analysts agreed. Ford, which lost $422.5 million in the first nine months of 1982, could lose at least $150 million in the fourth quarter, according to Merrill Lynch Pierce Fenner & Smith Inc. in New York. Healy put the loss at about $180 million.

Either way, it means Ford will lose close to $600 million for the year. Ford lost $1.06 billion in 1981 compared with a $1.17 billion profit in 1979.

Chrysler made a $266.2 million profit in the first nine months of 1982, largely because of the sale of its profitable defense subsidiary to General Dynamics Corp. of St. Louis for $336 million in March.

Chrysler likely will end the year with about the same amount of profit because Healy said the automaker probably will about break even in the fourth quarter. Or, Merrill Lynch says, Chrysler could lose some $19 million because the company was struck by the Canadian United Auto Workers union for 37 days over an immediate pay raise issue in contract talks in November.

Chrysler lost $1.1 billion in 1979 before getting some $1.2 billion in loan guarantees from the U.S. government.

AMC, which lost $150.6 million in the first nine months of 1982, will be in the red again for the end of the year, analysts said, although they did not have figures. AMC earned $62 million in 1979, the last profitable year for the domestic industry.

Volkswagen of America Inc. is a subsidiary of Volkswagenwerk A. G. of West Germany and does not release earnings separate from the parent firm.