Despite indications by Prime Minister Rajiv Gandhi that he favors improving relations with the United States, India is expected to continue major arms purchases from the Soviet Union, according to Indian and western defense analysts.

The assassination of Indira Gandhi, Rajiv's mother and predecessor, cut short a visit to Moscow by Indian Defense Minister S.B. Chavan that was to have settled, among other things, details of India's purchase of 40 advanced MiG29 fighter planes intended to counter the acquisition by neighboring Pakistan of F16s from the United States.

The MiG29 deal with India marks the Soviets' first sale of the plane to a foreign country.

Chavan may return to Moscow before the end of the year, although no date has yet been set, said an Indian Defense Ministry official and a Soviet spokesman. Both said they foresaw no changes in the arms relationship, under which the Soviet Union is India's main supplier.

According to a Soviet spokesman, Soviet Prime Minister Nikolai Tikhonov met Gandhi initially about a half hour after arriving for his mother's funeral, and the two "agreed to continue the present level of relations."

"As far as the Soviet Union is concerned," the spokesman said, "I don't think we have to be afraid about the future of our relations." In fact, the Soviets apparently have long perceived Rajiv Gandhi as an heir apparent and last year accorded him a warm and high-level welcome during a visit to Moscow with his family.

"The Soviets treated him royally," said a western diplomat.

The sale of the MiG29 to India before it has been offered to Moscow's Warsaw Pact allies, or even fully deployed in the Soviet Union is seen here as a measure of the importance Moscow attaches to its relations with India, the second most populous country and a leading force in the Nonaligned Movement.

A few of the twin-engined Migs, one of the newest planes in the Soviet inventory and one touted by Moscow as a match for the F16, are scheduled to be delivered next month, with the bulk to be shipped in 1985, defense specialists said. Eventually, India wants to produce the aircraft locally, but a final agreement on this has yet to be hammered out, the sources said.

The deal was negotiated earlier this year by the government of Indira Gandhi. After her assassination Oct. 31, Rajiv assumed the posts of prime minister and president of the ruling Congress (I) Party.

"This is the first time we're aware of that a first-line Soviet fighter is being exported to any Third World country prior to the modernization of the Soviets' own squadrons and those of the Warsaw Pact allies," said a western defense specialist. However, he said, it remained to be seen whether the deal would include the Soviets' latest avionics systems and advanced air-to-air missiles, such as the A10.

India's military dependence on Moscow -- about 80 percent of Indian military equipment is of Soviet origin or design -- has been the subject of domestic debate and has spawned some efforts to diversify the country's arms suppliers. While Rajiv Gandhi is not known to have been involved in the debate, he can be expected to continue the trend toward some diversification, Indian and western defense specialists said.

These specialists discount, however, the idea that because the 40-year-old former airline pilot reputedly is more prowestern than his slain mother was, he would initiate bold new departures in Indian policies.

In a major policy speech yesterday, Gandhi pledged that his government "will do all it can for the modernization of defense." He said India valued its "wide-ranging and time-tested relationship with the Soviet Union, based upon mutual cooperation, friendship and vital support when most needed." While he spoke of a need to acquire new technology, he generally stressed pursuit of his mother's policies.

"I see a greater amount of continuity rather than change," K. Subrimanian, the director of India's Institute for Strategic Studies and Defense Analysis. "There's a certain inevitability about it, given the international situation." A western defense analyst said Gandhi "is very much a captive of the system at this point" and cannot ignore India's already massive investment in Soviet military equipment. "It would be economic folly in the near term to make a radical departure," he said.

While Moscow apparently remains confident of its close ties with India, the Indian press has noted some signs of Soviet concern about the military diversification efforts. In the last five years, India has signed deals to purchase 120 Anglo-French Jaguar strike aircraft, 40 French Mirage fighter-bombers, a dozen British Harrier jump jets, four West German submarines and 14 British Sea King helicopters.

India is currently considering the purchase from one of four western competitors of about 600 long-range artillery pieces reportedly worth more than $1 billion, defense specialists said.

In the past, however, the Soviets have often come up with better offers once discussions on arms deals were under way between the Indians and western suppliers, leading some of them to wonder whether the Indian interest was a negotiating ploy, the specialists said.

So far, the United States has remained out of the market because of U.S. concerns about transferring technology that might end up in Soviet hands.

Now, according to western sources, a series of measures to overcome the U.S. concerns is under consideration in Washington for eventual discussions with the Indians. If negotiated and agreed with the Indians, these measures for safeguarding U.S. technology could allow sales of some items in which Indian authorities have expressed interest, notably howitzers, night-sighting equipment and submersible sonar devices, the sources said.

"It is because the U.S. is not willing to transfer technology to us that we buy from the Soviet Union," said Subrimanian. However, western specialists express doubt that other countries could match the deals offered by the Soviets for most of the equipment India buys. Besides low cost, low interest rates and long repayment terms, these often have involved production in India.

The Indian arms buildup has alarmed neighboring Pakistan, which claims that too much international attention has been focused on its own purchase of 40 F16 fighters from the United States.

"At a time when Pakistan is to get 40 aircraft over a four-year period, India will have obtained 300 to 400 planes over the same period," complained a senior Pakistani Foreign Ministry official recently in Islamabad. He argued that if India paid the full value for the military equipment it has ordered from the Soviet Union on "highly concessional terms" since 1980, the price would come to about $10 billion.

"We cannot afford any kind of arms race with India," the official said. "It's really a one-man race."