For Jimmy Carter and his aides, the hard-earned lesson of Democratic convention week is the danger of misjudging and underestimating an opponent. They made that mistake with Ted Kennedy and paid dearly for it. But the lesson will be worth the price if it steers away from their inclination to repeat the error with Ronald Reagan.

On the floor of the convention, as Carter was being renominated, his top strategist, Hamilton Jordan, was telling people it would be "easy" to beat Reagan in November, as "easy" as it had been to whip Kennedy in the spring.

The only thing wrong with the proposition was that the "defeated" Kennedy dominated Carter's convention and made the president seem a puny figure at a moment when he needed to be generating power for his uphill climb to overtake Reagan.

No matter that Kennedy's behavior on the podium Thursday night was tinged with the arrogance that had earned him the original enmity of Carter and his followers; no matter that it bordered on outright discourtesy to a president of his own party.

The fact that Kennedy consistently and almost contemptuously upstaged Carter every day of the convention ought to be the clearest warning to the Carterites that they may be making equally erroneous assumptions about the character and toughness of his next opponent, Reagan.

If one asks how Kennedy was able to dominate a convention ostensibly controlled by Carter, the answer has to be found in the classic Carter misjudgment of Kennedy's temper and tenacity.

From the beginning, Carter thought of Kennedy as a man with fatal character flaws, a weak man, captive to a family tradition he did not really share and dominated by a staff of ideologues. Carter thought Kennedy would crumble in defeat and was first perplexed and then vexed when he persisted -- even though he kept losing.

In late spring, when the last mathematical chance of a Kennedy victory had vanished the senator said he would withdraw if Carter met him in debate, as Carter had agreed to do last winter before he realized that the hostage crisis was a perfect excuse for ducking the challenge.

Carter refused the Kennedy offer that would have ended the contest in June, because, as his advisers arrogantly said, "Presidents don't debate losers." What they failed to recognize was that Kennedy spoke for 40 percent of the delegates in Madison Square Garden, and they had the power to turn Carter's renomination scene into shambles.

Once this elemental fact was recognized, Carter and his agents reversed roles and began an eager courtship of the man they had previously scorned. Kennedy, who had no reason to be generous, was not. Instead, he used the situation coldly to demean Carter -- and to teach the Carterites a few lessons in public relations.

The cruelest lesson was in the contrast of the speeches of the two men. Kennedy had wanted the debate in order to prove that he was not the bumbling, inarticulate man he appeared in the mindless first weeks of his challenge.

When Carter foolishly refused to meet him in debate, in a forum where Carter himself excels and where Kennedy's sweeping rhetoric could have been subjected to critical scrutiny, the senator bided his time. He knew that eventually Carter would have to provide a platform for him.

Desperate for a symbolic unity in the convention hall, the Carterites gave Kennedy control of the second night of the convention, and he seized the opportunity to make a stunning speech.

The pseudo-debate was completed on Thursday night, when Carter made a limping, defensive speech and then appeared almost importunate for a show of support from the senator. The disdain with which Kennedy treated Carter on the podium only added to the disgrace.

The damage of misreading Kennedy is done and cannot be erased. But it is not clear whether the lesson has been absorbed by Carter and been applied by him to his equally dangerous underestimation of his next opponent, Reagan.

What Carter ought to understand now is that his rivals are not likely to roll over at his command. Kennedy did not and Reagan will not.

Nor will Kennedy now do much to help Carter with Reagan. The senator understands perfectly well -- from the steely expressions on the podium -- that if they are in the White House in 1984, Jimmy and Rosalynn Carter will do all in their power to deny the next nomination to him. He will treat them accordingly.

Carter must steel himself to face Reagan alone. He must do what he has refused or been unable to do so far: construct some semi-plausible defense of his own record. In his single day of campaigning this spring, in Ohio, he argued that America was "turning the tide" on its economic problems. That claim was instantly ridiculed. In convention hall, he argued that a mediocre first term guaranteed a better second term. That argument did not take wing either.

He has to do better than that -- or he will be watching the world from Plains and wondering how he ever so badly misjudged his opponents.