Jimmy Carter presents a case study in the fine art of rising on the wings of failure. His policies meet defeat after defeat. But he cleans up in the primaries. How come?

The answer has something to do with his leading Democratic opponent and something to do with his own political skills. But the decisive factor is the mood of the electorate in the face of this country's present problems.

Confessions of error write the recent record of the administration. The latest development is the new tightening of bugetary, credit and energy policy announced Friday. Nobody knows whether it will work. The president has postponed laying out in detail the proposed budget cuts -- apparently until the New York primary on March 25. Without those details the budgetary impact of the energy proposals cannot be assessed. But these circumstances suggest that the purpose of the new program is more to short-circuit criticism than to deal with fundamental problems. Especially given the reasons why the new economic package was required.

It was required because of the lax budget presented by the president to Congress only six weeks ago. That budget envoked a specter or runaway inflation. The president was obliged to take a second cut last week to avert financial panic. In effect, he was running away from his own mistakes.

Even as he announced his original budget, the president was setting out a Carter doctrine to protect the vital American stake in Saudi Arabia and the other major oil producers around the Persian Gulf. But the president, ever a man for fine words and nice gestures, did nothing to thwart the radical forces that truly threaten instability in the area. Lybia, Aden, the left wing of Palestine Liberation Organization and the Cuban mercenaries went untouched.

Instead, Carter sent emissaries asking for measures of support from threatened friends -- Pakistan and Saudi Arabia and Israel. Those countries, finding weakness in the United States instead of leadership, hung back. So the true content of the Carter doctrine to date is a series of alibis for doing almost nothing.

Iran presents a slight variation on the same theme. The commission sent out by the United Nations secretary general, Kurt Waldheim, to spring the hostages has returned to New York in semi-disgrace. It did not even get to see the hostages. It made all kinds of concessions -- including implicit admission of henious crimes committed by the shah with the complicity of the United States. It established the principle of negotiation under duress.

Still the commission retains the full support of the administration. Secretary of State Cyrus Vance, after seeing Waldheim and the commission maintains it represents the best way out. In the famous last words of appeasement, he counsels "patience."

Despite this dreary performance, the president has made a brilliant beginning in the 1980 campaign. He has won truly impressive victories in Florida, Alabama, Georgia, New Hampshire, Vermont and Iowa. A big win is shaping up in Illinois, and he will probably even win New York.

Sen. Edward Kennedy, of course, is one reason. All kinds of labels are applied by voters who have to be articulate about things they feel only dimly -- Chappaquiddick, abortion, cheating at Harvard, the Kennedy family, being a big spender. But the central fact is that the senator has not inspired confidence. Most Democratic voters don't trust him.

Kennedy's presence in the race has made Carter seem to stand tall. Abysmal performance on the most critical matters has not proved telling. It is eclipsed by the Kennedy negative.

The president has made the most of the opening. He has bustled about on television in ways suggesting he was the master of problems that have in fact mastered him. He has talked in accents of discipline. He has wrapped himself in the flag and caused critics to look unpatriotic.

On top of that, skillful appeal has been made to particular constituencies. By laborious process of consultation, Congress was made an accomplice of the new financial measures. The vanity of the business community was engaged by invitations to be present at the unveiling on the new proposals. Labor was thrown a big bone in the form of concessions on wage restraint. Robert Strauss and Sol Linowitz have been mobilized to blind Jewish voters to the shabby treatment of Israel.

Those tactics work, however, only because the country wants them to work. There is not abroad in the land a keen sense of the nation's troubles. Most of us think we can beat inflation and the energy problem and the Russians without making serious sacrifices. We prefer Boy Scouts to able leaders, moral eyewash to home truths, collages of bits and pieces to coherent programs. So the serious charge that can be leveled against Jimmy Carter is that he has read the mood and turned it to advantage -- been the opiate of the American people.