International Business Machines Corp. said yesterday that its first-quarter profit fell 18 percent from a year earlier, its first such decline since the fourth quarter of 1981.

Meanwhile, Chemical New York Corp. and Marine Midland Banks Inc., two money-center banking companies, reported first-quarter gains.

IBM's net income dropped to $986 million ($1.61 a share) from $1.202 billion ($1.97) a year earlier. Revenue edged up only 2 percent to $9.77 billion from $9.59 billion.

In the four previous quarters, the computer giant had shown average year-to-year earnings growth of 20.6 percent.

Yet the lower profit in the latest quarter was expected. Earlier this year, IBM had predicted flat results for the first quarter, but on March 22 it revised its forecast and said profit would decline.

However, IBM also said it expected business to pick up in the second half of 1985 so that full-year results would show "strong growth."

Some industry analysts embraced that outlook. "The scenario the company sets forth definitely makes sense," said George Elling of Oppenheimer & Co.

Michael Geran of E. F. Hutton & Co. wrote in a current report that IBM "should reach 40 percent shipment growth in the second half of 1985; this should turn profit margins and accelerate earnings-per-share gains, and carry very strong momentum into 1986."

There had been suggestions IBM might write down the value of its existing inventory of PCjr home computers, which IBM stopped making this month, but the machine was not mentioned in the company's report.

Regardless, Wall Street appeared glad to have IBM's results behind it. IBM's stock closed at $127.50, up $1.62 1/2.

IBM said the first-quarter decline reflected two factors: the strong dollar and a hiatus in shipments caused by introduction of a new large-scale computer system, the 3090, and related data storage products.

"We experienced a slowdown in installation activity in our high-end storage and processor installations as some customers paused to evaluate our recently announced IBM 3090 processor and enhanced IBM 3380 storage devices," IBM President and Chief Executive John F. Akers said in a statement.

"In addition, the continued strengthening of the dollar to the recent high levels reached in March and its effect on currency exchange rates had a significant negative effect on the first-quarter results," Akers said.

If currency exchange rates had remained the same as a year earlier, IBM's profit would have dropped 7.1 percent, the company said.

But Akers also said "customer reaction to our high-end products is favorable, worldwide new-order activity is encouraging and we expect shipments to increase as the year progresses, particularly during the second half."

Jonathan Fram of Paine Webber Inc. said IBM would benefit, beginning in the current quarter, from a combination of orders for the new 3090 large-scale computers and continued demand for IBM's older top-line family of mainframes, the 308X series. Chemical New York Corp. and Marine Midland Banks Inc., reported double-digit gains yesterday in first-quarter earnings. They each credited growth in interest income.

Chemical said strong gains in service fees and foreign exchange trading profits also contributed to a 10.3 percent profit increase in its first quarter.

Marine Midland, which ranks as the 17th-largest banking company, said its non-interest income also grew and contributed to a 14.4 percent profit gain.

Chemical and Marine Midland were among the first major banking companies to report earnings for the first three months of 1985. On Wednesday, fifth-ranked J. P. Morgan & Co. Inc. posted a 12.7 percent gain for the quarter.

Chemical, the sixth-largest bank holding company and the parent of the nation's sixth-biggest bank, Chemical Bank, said its net income was $89.7 million ($1.68) in the first three months of the year, compared with $81.3 million ($1.58) a year ago.

Net interest income rose 14.3 percent to $457.2 million, principally because of higher domestic loan volume. Chemical said the difference between average rates it must pay for funds and the rates at which it was able to lend or invest them widened to 3.90 percentage points from 3.76 percentage points in the first quarter of 1984.

Chemical said "a negative factor" for the quarter was that its level of nonaccruing or renegotiated loans rose to $1.26 billion as of March 31 from $899 million a year ago and $1.196 billion at the end of 1984. Nonaccruing loans generally include those on which payments of principal and interest are at least 90 days past due.

Marine Midland, parent of the nation's 12th-largest bank, Marine Midland Bank, said its profit rose to $25.9 million ($1.23) for the first quarter from $22.6 million ($1.05) a year earlier. Net interest income rose 15.4 percent to $184 million.

Marine Midland's nonaccruing and reduced rate loans were $526 million on March 31, compared with $430 million a year ago.