The $40 billion pipeline project that is to link U.S. population centers with vast untapped reserves of natural gas in Alaska is facing delays of at least two years because some of the world's largest oil companies and banks are balking at the financing requirements.

Both the U.S. and Canadian governments, as well as representatives of the big companies that are promoting the project, remain publicly optimistic that the hurdles will be cleared and that gas from Alaska's North Slope someday will flow across Canada to California and the Midwest.

"I think the pipeline will be built and I think there is a better than even chance it will be built before 1990," said the Canadian government's pipeline expert, Mitchell Sharpe, in an interview in Washington last week.

Sharpe and other backers of the mammoth project blame the recession, high interest rates and a glut of energy supplies for making Wall Street wary of the project.

Privately, however, friends and foes of the scheme acknowledge that it is in deep trouble for reasons that go beyond those immediate concerns.

On May 5, for example, the Alaskan state government, while declaring its "strong support" in principle for the pipeline, announced that it would not put up any money for it "at this time." Among other things, Alaskan authorities called attention to the fact that the "marketability of the gas is still an unresolved issue."

Critics of the pipeline are even more outspoken on the seriousness of the situation.

"The only way of keeping this project from going on the blocks would be a federal loan guarantee," said Rep. Tom Corcoran (R-Ill.), who opposes any federal "bailout."

Corcoran has introduced a joint resolution in Congress opposing a government loan guarantee. He maintains that Alaskan gas probably will not be needed in the Midwest until the year 2000 because of an ample supply of relatively inexpensive U.S. and Canadian gas.

But if the pipeline is built, he says, utility companies will be forced to charge customers for expensive Alaskan gas mixed in with those cheaper supplies.

At a meeting in Salt Lake City April 30, the three international oil companies and 10 pipeline companies that comprise the U.S. consortium for the deal issued a new statement of confidence in the project. However, they also agreed that a delay of up to two years was needed to work out financing problems.

This would postpone completion of the pipeline at least until 1989. A completion date of 1983 was envisioned when the project was launched in the late 1970s.

"The partners have extended themselves to the limit of their capacity," acknowledged John G. MacMillian, chairman of the Northwest Energy Co., in a letter to President Reagan May 11. MacMillian said the project would go ahead--but only when "an acceptable financing plan can be developed."

The financing problems center on the estimated $25 billion needed to build the 745-mile section of pipe between Prudhoe Bay and the Canadian border and construct a conditioning plant to purify the gas before it enters the line.

Exxon, Atlantic Richfield and Standard Oil of Ohio, the North Slope gas producers, have agreed to put up $9 billion in return for an equity interest. The 10 pipeline companies would put up another $8 billion. The state of Alaska, commercial banks and other investors would bridge the gap between that $17 billion and the final costs.

But Citibank, Chase, Morgan Guaranty and Bank of America have refused to put up any money until the consortium can show them contracts with gas purchasers, in this case U.S. pipeline companies. The bankers also reportedly want to learn more about the accounting "methodology" behind the cost estimates for the project.

Even the three oil companies that would benefit directly from the pipeline have been skeptical of the estimates. A year ago Sohio's chairman, Alton W. Whitehouse, was quoted as saying the cost of the Alaska segment could go as high as $30 billion. And Exxon, Sohio and ARCO have flatly refused to put up more than $9 billion.

These snags already have caused political and diplomatic repercussions, and could have more before the problems are solved.

Despite domestic opposition, Canadian Prime Minister Pierre Elliott Trudeau's government gave its support to the private consortium building the 1,500-mile Canadian section of the line. Two sections of the line, a 293-mile leg from Edmonton to the U.S. Pacific Northwest and a 364-mile leg from Edmonton to the U.S. Midwest, will be finished in a few months. The Foothills Pipe Lines Co. has also expended some $200 million in engineering studies for the unbuilt parts of the line to Alaska.

Canada's inducements to build the line are jobs for its steel industry, the incentive the pipeline will give to develop its own untapped natural gas reserves in the Mackenzie River basin and the option it has to use the pipeline to export more Canadian gas to the United States.

However, further delays in the Alaskan segment could leave Canada holding the bag. The delays already have sparked criticism of the Trudeau government's overall energy policy.

When finished the pipeline would provide 4 or 5 percent of the nation's natural gas requirements. Oil company officials have indicated that the pipeline would be an incentive for them to expand exploration for new gas in the North Slope that could benefit the nation far into the 21st century.

Nevertheless, it is uncertain how far the Reagan administration will go in helping the U.S. consortium over its present difficulties.

The leader of the U.S. consortium, pipeline magnate MacMillian, is a high-profile Democratic Party contributor and fund-raiser. Last fall, an array of former Carter administration officials turned private lawyers and lobbyists worked for a special congressional waiver sought by MacMillian.

The waiver was intended to make pipeline financing more appealing to private bankers and investors, by shifting some of the risks to American consumers. It allowed consumers to be billed for the cost of the $6 billion conditioning plant, and the U.S. and Canadian segments of the pipeline, before gas actually began flowing to the United States--but only under conditions approved by the Federal Energy Regulatory Commission.

Paid to work for passage of the waiver package were such Carterites as former Democratic National Committee chairman Robert Strauss, former vice president Walter Mondale and Anne Wexler, former Carter special assistant.

Wexler's Washington firm registered as a foreign agent representing Canada's Foothills Pipe Lines. The filing with the foreign agents registration office said the firm would draw on its "experience and ongoing dialogues with recognized opinion leaders, representatives and government officials." Payment included a $10,000 retainer and a $10,000 "success bonus" if the waiver passed, which it did.

Nevertheless, pipeline backers admit, the waiver failed to reassure bankers and Wall Street investors as hoped.