President Reagan has been learning the hard way this summer what Jimmy Carter could and perhaps did tell him -- that Menachem Begin can be a difficult man to deal with.

Carter never developed for Begin the kind of intense, visceral dislike that he had for West German Chancellor Helmut Schmidt. But the Israeli prime minister, with his stubborn independence, NEWS ANALYSIS his tendency to lecture all his listeners on the tragic history of the Jews and especially on the Holocaust, his incessant haggling over the finest points of detail, thoroughly exasperated the 39th president.

By the end of his term, Carter made no secret of his almost unbounded admiration for the late Egyptian president Anwar Sadat, one of the two men who shared with him the 13-day ordeal that produced the Camp David peace accords. As for the other Camp David participant, Begin, Carter put him in the same category as a television correspondent who seemed to take special delight in tormenting the former president.

Now it is Reagan's turn to deal with Begin, and within the last two weeks the experience has produced two angry outbursts from the White House over Israeli conduct of the siege of Beirut.

The first occurred Aug. 4, when Israeli ground forces pushed into West Beirut just hours after Reagan had sternly warned Israeli Foreign Minister Yitzhak Shamir of the importance of maintaining the cease-fire during the delicate negotiations being conducted by U.S. special envoy Philip C. Habib to arrange a peaceful withdrawal of the Palestinian guerrillas from the city.

The second came last Thursday, when, with the Habib negotiations apparently on the verge of success, Israel launched a furious, 10-hour bombardment of Beirut with wave after wave of its warplanes.

In both cases and throughout the agonizing siege of Beirut, Ariel Sharon has been depicted as the "heavy," a role for which the scowling, pot-bellied defense minister at times appears well-cast. Thus, senior Israeli officials made it known last week, Begin responded to Reagan's first angry message by telling Sharon there were to be no more advances on the ground without prior government approval.

As a result of Thursday's bombing and the second angry message from Washington, Begin joined other members of the Cabinet in severely criticizing Sharon and taking from him the sole authority to order air strikes on the Lebanese capital.

Newsweek reported in its editions appearing Monday that Sharon, who has accused Habib of distorting Israel's actions in Beirut, demanded to meet President Regan and other U.S. leaders in Washington to argue Israel's case. Secretary of State George P. Shultz "frostily vetoed" the visit, the magazine said, and pointedly told Sharon that Habib spoke for the United States in the crisis.

It is taken for granted here that Sharon is unenthusiastic about the Habib negotiations and at times has appeared to be trying to undermine them. But the events of Thursday also suggest that Begin, fending off the pressure from Washington and the general criticism of Israel's actions in Lebanon, has on occasion found it convenient to recede behind the considerable shadow cast by his defense minister.

The bombing of Beirut began at 6 a.m. and was publicized widely in Israel shortly thereafter by early-morning news reports. Eight hours later, Begin met with his Cabinet and was later described as upset and angry at Sharon's decision to order the air strikes. But in the intervening time, the prime minister apparently did nothing to call off the bombardment.

It is possible, as some here suggest, that Sharon misled Begin about the extent and intensity of the Israeli assault. It is also true that under Israel's Cabinet form of government the prime minister's unilateral powers are not comparable to those of an American president. But Begin still had power to issue a direct order to his defense minister, or at the very least to convene an early-morning emergency Cabinet meeting to hear an explanation of the bombing from Sharon.

Begin did neither. While the bombs fell on Beirut, he spent much of the morning in the Israeli parliament, delivering a speech of more than one hour in the course of a debate over the conduct of the war. Later, he met with a group of American Christians, telling them, "We are nearing an agreement" for a peaceful resolution of the crisis.

The news reports of the new Israeli assault prompted several Cabinet ministers opposed to Sharon's tactics to call for an emergency meeting. But the Jerusalem Post later reported, and senior Israeli officials confirmed, that when the Cabinet finally did meet at 2 p.m. it was at the instigation of Sharon and Chief of Staff Rafael Eitan, who were seeking authorization for another "tactical" move on the ground by the Israeli Army.

By then, however, Reagan's threats to call off the Habib mission unless the bombing stopped had been delivered to Begin through U.S. Embassy channels. As a result, Sharon and Eitan were turned down and the defense minister was stripped of the freedom to order air strikes on Beirut on his own initiative.

Senior Israeli officials who have seen the various "crises" in American-Israeli relations come and go over the years seemed unperturbed by this latest episode of strain. It was, they said, a "temporary" thing, of no lasting importance to the deep ties that bind the two countries together.

A veteran observer of these matters said the Begin government took the warning of Aug. 4 far more seriously than it did the angry blast that came from the White House last Thursday. The reason, according to this analysis, was that in early August the Habib negotiations had still produced very little in concrete results.

But by Thursday, administration officials knew that Habib was close to achieving the long-sought agreement on a peaceful withdrawal of the Palestine Liberation Organization forces. In the Israeli view, the Reagan administration simply had too much at stake in Habib's mission to halt it just as it was reaching the verge of success.

The episode, according to this official, also demonstrated anew the limits of putting pressure on Menachem Begin. The prime minister finally responded to Reagan's message and even managed to emerge from the day's events looking something like a dove compared to Sharon.

But while Begin will act when confronted with an angry president, this analyst warned, any action that goes beyond threats and angry words is bound to produce an unpredictable but counterproductive Israeli response.

"You have to handle him in a very peculiar manner, knowing that if you do something concrete against him, he will do something concrete against you," the official said. "This is the Begin who was not afraid to fight the British during World War II. The president calls and Begin says, 'Oh, I see you are upset,' and calls off the air raids. But the moment you hit him, he hits back."

The official said Reagan administration officials understand this about Begin and are therefore unlikely to go beyond the kind of threats they issued this week. The president's news conference remarks Friday, in which he seemed deliberately to be softening the impact of his message to Begin the day before, tended to confirm the Israeli assessment that nothing that has happened in Lebanon has shaken basic administration support for Israel's goals in that war-torn country.

The Israelis know that in Reagan they have an American president who, by instinct and ideology, is far more willing to go along with their decisions than was his predecessor. The limits of the administration's influence on the Begin government, which on Thursday produced a halt in the Israeli air assault on Beirut 10 hours after it had begun, were much in evidence last week in Jerusalem and in the skies above the Lebanese capital.