The price of gasoline at some service stations here and elsewhere in the nation has edged up in recent days, as major oil companies--after months of steady decreases and the announcement of lower OPEC crude oil prices--try to widen their profit margins and take advantage of what they hope the market will bear.

Officials of Exxon, Amoco, Shell, Gulf, and Texaco said those companies have raised the wholesale prices to their dealers in the past two weeks by 1 to 3 cents a gallon. But because of "competitive conditions in the market," the companies have since lowered those prices, resulting in smaller net increases in some cases and no increase at all in others.

Dealers hit by the roller-coaster ups and downs of supplier prices have in some cases chosen to pass along the increases to motorists, according to a random survey of local stations. Other dealers said they held their prices steady, for fear of losing business.

Here is a summary of the increases made by the companies in the Washington area and in some cases passed on to consumers:

* Exxon raised its wholesale prices by 3 cents a gallon on March 9. But "in response to market conditions," a company spokesman said, Exxon reduced its wholesale price by 1 cent a gallon on March 12 and .7 cents a gallon on March 18, resulting in a net increase of 1.3 cents a gallon.

* Amoco raised prices by 2 cents a gallon on March 10 and then dropped 1 cent a gallon on March 15 and .7 cents a gallon on March 19, resulting in a net increase of .3 cents a gallon.

* Texaco raised prices by 1 cent a gallon on March 10 and then dropped the price by 1 cent a gallon on March 17. On March 22 the company raised prices again by 1 cent a gallon, according to a local Texaco operator.

Gulf raised prices 2 cents a gallon in early March. Since then, the company has dropped prices twice, according to spokesman Michael Kumpf. He would not disclose the precise amount of the reductions, except to say that they were slightly less than the amount of the increase. "It's a wash," Kumpf said.

* Shell raised prices 1 cent a gallon on March 10 and dropped prices 1 cent a gallon on March 22.

Company representatives for the most part played down the significance of the price maneuverings. "There's nothing unusual about this," said the Exxon spokesman. "We are constantly assessing market conditions; we are moving all the time."

However, gasoline wholesale prices in general have been falling steadily for more than a year. Amoco, for example, had 25 wholesale price changes in the Washington area between last July and March 12. All of those changes were for price reductions, except for the 2 cent-a-gallon increase that was implemented on March 10, according to company spokesman Roger Friskey.

"We watch closely what is happening on the street and what the competition is doing to get an indication of what the traffic will bear," Friskey said. "We felt conditions warranted a certain firming of prices."

He added that the increase didn't work as well as the company had hoped "because people are so price-conscious that a penny or two really does make a difference in where they buy their gasoline."

Tom Crosby, a spokesman for the American Automobile Association, which conducts regular gasoline price surveys, said he believed the current market instability may be linked to the 5 cent increase in the federal gasoline tax that is scheduled to take effect April 1.

Mike McGrady, owner of Century Amoco in Germantown, Md., said he waited a full day after his supplier raised prices before he increased his pump price. "I waited to see what everyone else would do," McGrady said. On the second day he raised prices but subsequently lowered them when his wholesale price fell, he said.

"One or two customers asked what was going on," McGrady said. "But we didn't know then and we don't know now." Whatever the basis for the pump price, the motorist can count on one thing--a wide variation from one station to another, according to the AAA's Crosby.

The difference in price for regular leaded gasoline at full service pumps was a dramatic 47 cents a gallon, according to the latest AAA survey. The high was $1.539, compared to the low of $1.069. Self-service leaded regular gasoline ranged from 96.9 cents a gallon to $1.189 a gallon--a difference of 22 cents.