Rajiv Gandhi, the 40-year-old son of slain leader Indira Gandhi, made his first moves today to assert authority as prime minister and quell the sectarian violence that has rocked India since Wednesday's assassination.

Gandhi formally reinstated all but one of his mother's Cabinet ministers. He also fired the chief civil servant in the capital for his failure to move more quickly in controlling the violence.

The new Cabinet, in its first official act, announced that it has ordered a full inquiry into Indira Gandhi's death. The inquiry will be headed by a Supreme Court judge.

The prime minister met yesterday and today with a series of foreign leaders, including Pakistani President Mohammed Zia ul-Haq.

After meeting with the new prime minister, Zia said he expected a new approach "by a young man who would not be affected by old animosities between the two countries."

Gandhi's ability to get a grip on the government and reduce the turmoil is being seen as a crucial test for the inexperienced leader, who was an airline pilot until four years ago and who acknowledges that he came to politics unwillingly.

Although Gandhi was criticized by opposition parties within 48 hours of being sworn in, he has begun to draw some favorable comment and may benefit from the reduction in the violence that is now more evident in the capital and elsewhere, political observers said.

In an editorial yesterday, the Times of India newspaper said Gandhi had "passed one test of leadership remarkably well" by showing "an extraordinary capacity to remain calm in the face of a great personal and national tragedy and the mad reaction to it."

Pran Chopra, a director of the Center for Policy Research and a widely respected political commentator, said in an interview that "what we are looking for at this stage is not what kind of a prime minister he will make, but what kind of a person he is."

Chopra said that "the last three days have been both revealing and reassuring," noting that Gandhi was thrust into office "completely unprepared" and as "an unknown quantity." The composed and calm figure he displayed during his mother's nationally televised funeral has probably helped his image, he added.

Chopra said he was impressed by Gandhi's sending state governors -- who had rushed to Delhi upon the news of Indira Gandhi's death -- back to their regions to help control rioting, and by the decision to tour riot-scarred sections here before dawn Saturday, prior to the funeral.

It was during that tour that Gandhi reportedly ordered the police and military to beef up what had been inadequate security and told civil servants to make sure of responses at emergency telephone numbers that citizens are supposed to call for help.

Many innocent victims of the violence here claimed that no one was available to help or protect them. Many Sikhs, who have been attacked by Hindus seeking revenge for the killing of Indira Gandhi by two Sikh bodyguards, claim the police either encouraged the attackers or looked the other way.

Gandhi's reappointment of his mother's Cabinet, with the exception of the minister for planning, came as no surprise. The late prime minister had some strong advisers in her entourage. However, many political commentators here have said she rarely used them. The question now, said one observer, is whether the younger Gandhi will make use of them.

Even if calm returns here, a perhaps bigger challenge to Gandhi could come if retaliatory violence against Hindus occurred in the northern state of Punjab, where Sikhs are in the majority.

Thus far, Punjab has remained tense but under control, according to Indian news services. But many Sikhs in Punjab advocate independence from an India that is 85 percent Hindu. Sikh extremists in Punjab carried out a campaign of terror there against moderates until June, when Indira Gandhi ordered the Indian Army to subdue the extremists holding out at the Sikh Golden Temple shrine at Amritsar.

That attack outraged India's 15 million Sikhs and ultimately led to the revenge killing of Indira Gandhi.

In a nationwide radio broadcast Friday, two days after being sworn in, Rajiv Gandhi demanded an end to the violence that followed the assassination and said that "the government will ensure the safety of life and property of every citizen, irrespective of his caste, creed or religion." It was meant to comfort the Sikh victims who had been set upon by Hindu mobs.

Gandhi's most important diplomatic meeting was with Pakistan's President Zia. Their two countries have fought each other three times in the past 37 years, and ties are strained.

But Zia said that "all is quiet on the Indo-Pakistan borders" and "there is nothing to worry about." Zia said he had a good response from Gandhi to plans for new dialogue and "we hope that our bilateral relations will be still better."

Gandhi got a boost from British Prime Minister Margaret Thatcher, who told reporters, "I respect him greatly." French Prime Minister Laurent Fabius emerged from a meeting with Gandhi to say French President Francois Mitterrand had the "highest personal regard" for the new Indian leader.

The expectation here is that within the next few weeks Gandhi will announce elections to be held in January in quest of a public seal of approval on his accession to power. The opposition parties generally are regarded as weak and fragmented.

If Gandhi were elected, Chopra said, his priorities should be to end "the politics of confrontation and strife" that he said Indira Gandhi brought to Indian politics.

Chopra argued that what he views as the excessive power concentrated in the late prime minster's hands depleted and paralyzed the machinery of government in the states and in the federal bureaucracy as well.

Even the failure to quickly curb the violence after the assassination, he said, was a reflection of the breakdown of local administration, which is supposed to handle such problems. It also reflected the lack of sound ministry-level advice on such matters as when to call up the Army and how fast to impose curfews, he said.

Some observers here who share this view say that the chief civil servant responsible for law and order in New Delhi, who was fired today, may well have been a scapegoat for a deeper problem.