Directors of Cities Service Co. last night approved a merger with Occidental Petroleum Corp. after Occidental improved its previously rejected offer for Cities to $4 billion from $3.8 billion.

The approval ended a frantic three-week search by Cities for a merger partner to replace Gulf Oil Co., which backed out of a $5 billion bid for the Tulsa-based oil company earlier this month, citing Federal Trade Commission objections to the proposed merger. The merger is subject to stockholder and governmental approval. In acquiring Cities, Occidental would obtain extensive domestic oil and natural-gas reserves, something securities analysts say the Los Angeles-based company sorely lacks. Occidental gets most of its petroleum from overseas sources that occasionally have proved unreliable.

The merger also would give Occidental a U.S. gasoline refining and marketing business, although some analysts speculate that those operations might be sold after the merger.

Under Occidental's new offer, the company would pay $55 a share for 45 percent of Cities' stock and then offer a package of securities worth about $50 a share for the remaining stock. Cities' stock, which did not trade yesterday pending the outcome of the board meeting, closed Tuesday at $45 a share.

Occidental initially offered to pay $50 a share for Cities and, after Cities' board rejected that offer, went directly to stockholders with a $50-a-share offer for 49 percent of Cities' stock.

The merger of Occidental and Cities would create a company with combined 1981 sales of $23.6 billion, making it the nation's 12th-largest industrial concern and eighth-largest oil company if ranked by sales for that year.

The merger would be the third-largest ever, behind E.I. du Pont de Nemours & Co. Inc.'s $7.5 billion takeover of Conoco Inc. and U.S. Steel Corp.'s $6.5 billion acquisition of Marathon Oil Co., both of which took place last year.

Cities' board approved yesterday's merger proposal after a three-hour-and-45-minute special meeting in New York called to consider bids from several other companies for all or part of the company.

The board meeting was joined by Occidental Chairman Armand Hammer and several members of Occidental's board as discussion centered on the Occidental offer. The building the Cities offices occupy in New York was surrounded by limousines as the meeting went on, and the final decision, which came about 8 p.m., was toasted with champagne, sources said.

It was not known what other companies submitted bids for Cities, but Northwest Energy Co., a Salt Lake City-based natural-gas company, said yesterday it was interested in buying Cities' pipeline operations, and Amerada Hess Corp. last week expressed interest in Cities' refining, marketing and transportation operations. Those offers were rejected in favor of the bid from Occidental.

Cities' shareholders will have until midnight on Sept. 4 to submit their shares to Occidental under the cash offer. If Occidental succeeds in purchasing the first 45 percent of the Cities shares, it will offer a package of securities containing a zero-coupon bond worth $25.32 and 0.41 percent of a share of Occidental preferred stock with a par value of $100 for each remaining Cities share. Because the preferred stock will have a market value considerably less than its par value, the value of the second-step package is about $50 a share.

The improved offer should be sufficient to cover most of the paper losses of Wall Street professionals who got stuck with high-priced Cities stock when Gulf suddenly dropped its $63-a-share bid earlier this month and Cities stock plummeted to $30 a share. After Gulf dropped its offer, Cities sued it for breach of contract and said it would find a new buyer or liquidate itself.