With the West Coast gasoline shortage providing the backdrop, President Carter and California Gov. Edmund g. (Jerry) Brown Jr. engaged in an elaborate political waltz around each other at the White House yesterday that ended with a prediction that the shortage soon will begin to ease.

By the end of the day, Carter announced a series of steps he said should alleviate the California shortage, and predicted that after a low point this month gasoline will begin to become more available in that state during the summer.

The California governor led a delegation of state and congressional officials to the White House in the morning to meet with the president and Energy Secretary James R. Schlesinger Jr.

Emerging from the meeting, Brown held forth for almost 30 minutes on the driveway in front of the White House, pledging cooperation with the administration, warning of a serious national recession if gasoline supplies continue to dwindle and generally ducking and sliding around questions of his presidential ambitions and personal relations with the president.

Not to be outdone, shortly after Brown had left the White House grounds, Carter aides announced that the president would appear personally before the television cameras to say a few words about the gasoline shortage and the actions he had ordered.

The president was joined by Schlesinger, who, in contrast to Carter's recent gloomy pronouncements on the subject, said the administration does not expect the california shortage to spread nationwide. He said the government expects an increase in oil imports because of heavier production in Iran, and also expects U.S. refiners to begin using more of their existing crude oil stocks to produce additional gasoline.

Because of these factors, he said, "It is safe to say we hope the worst is over."

The White House yesterday also released an Energy Department report that blamed the California shortage on a number of factors, primarily the interruption in oil imports from Iran and a growth in demand for gasoline in california exceeding the national average.

The reports said that while West Coast refiners have been "somewhat conservative" in the use of existing crude oil stocks to ease the gasoline shortage, there is no evidence that gasoline is being withheld deliberately from the market to raise prices.

Nevertheless, Carter, in one of the steps he announced yesterday, ordered the energy Department and the antitrust Division of the Justice Department to monitor the oil refining and distribution system for indications of illegal activity.

Gasoline was the dominant subject all day at the White House. But the other, underlying subject was presidential politics and the likelihood that Brown will challenge Carter for the Democratic nomination in next year's primaries.

While Brown held forth to reporters on the driveway, Interior Secretary Cecil D. Andrus was in the White House press briefing room explaining a new administration water policy. But no one seemed to be paying much attention.

"I just came here for some gasoline," Brown replied when asked if he agreed with the demand of Sen. Alan Cranston (D-Calif), a member of yesterday's delegation to the White House, that Schlesinger be fired. "I'm not going to call for his resignation until I get some. If June is better than May, I may take a more benign view."

But the governor also strongly suggested that he blames Schlesinger's Energy Department for at least part of the shortage.

"I wouldn't be surprised if their regulations and the desire of the oil companies to make a few extra bucks have contributed substantially to the shortage," he said.

Brown also warned of dire economic consequences nationally if the gas shortage continues.

"California is in a state of shock, frustration and anger," he said. "I have a hunch it [the shortage] will spread. Gas and job growth have been associated. If we are told no more gas, that means no new jobs for the rest of the year. And that means a recession and serious challenge to this country."

While Brown appeared skeptical of the president's prediction that the shortage will begin to ease in June, he said he would give Carter "the benefit of his presentation." He said California officals would consider the actions urged on them by president, including an easing of some environmental regulations.

"A lot of people think it's a plot-that the White House is out to get California because of me," Brown said. Of course, he added, "I don't believe that myself."

In his appearance before reporters, the president stressed the importance of cooperation among government officials at all levels in dealing with the energy shortage.

He said the california situation should be eased by a change in the gasoline allocation formula, which took effect May 1, to supply additional fuel to high growth areas.

In addition, Carter yesterday announced several other steps, including an order that only essential operational military units receive the 100 percent of supply allocation that normally goes to Defense Department units. The other measures largely have to do with monitoring the flow of gasoline to the West Coast, and would not in themselves increase the supplies.

The president said the administration has also asked California officials to take several steps, including the strict enforcement of the 55 mph speed limit and a temporary easing of environmental standards on lead content and vapor pressures of gasoline that exceed national requirements. CAPTION: Picture, California Gov. Brown, flanked by Rep. Ronald V. Dellums (D-Calif.) and Sen. Alan Cranston (D-Calif.), faces reporters after meeting with President Carter. AP