President Reagan today sets out in search of history, beginning a second term in which he could leave a more lasting imprint on American government and foreign policy than any president since Franklin D. Roosevelt.

Since his reelection, Reagan has focused attention on controlling the superpowers' arms race and the huge federal deficits, the most pressing items on his second-term agenda.

If successful, he has a chance to capture the allegiance of a generation of American voters who were just coming of age when his predecessor, Jimmy Carter, was struggling with the economic traumas of the 1970s.

He is also in position to leave a lasting and perhaps radical mark on the nation's most far-reaching social engineering program: the federal tax laws.

And he may have more opportunity than any president since Roosevelt to alter the face of the Supreme Court where five justices are now 75 or older.

All these prospects depend to a great extent on the fortunes, and skills, that Reagan brings to a second term -- if the economy stalls, if the nation is plunged into a war, if Reagan's health deteriorates, he could be denied these triumphs, and his place in history recorded alongside other presidents of the last generation whose early hopes ended in disappointment and failure.

Reagan appears to come to the second term without big new plans or fresh ideas. Rather, he views the oath-taking today as just another way-station on the same road he has been traveling since the early 1950s.

"I came here with an idea in mind of what I felt should be done," he said last week. "I've been out on the mashed-potato circuit talking about that for three or four decades. And so we started in with the plan. As you know, the only thing that has remained constant are the pessimists. They're still around. They said the plan wouldn't work. Now that it's working, they said it wouldn't last. Well, they were wrong the first time and they'll be wrong the second time."

The "plan" called for economic growth without inflation, lower tax burdens on individuals, a squeeze on the size and scope of government, a balanced budget, the expansion of American military muscle and a cold-eyed view of the Soviet Union that would lead to an era of superpower stability.

"This administration's objective must be a healthy, vigorous, growing economy that provides equal opportunities for all Americans with no barriers born of bigotry or discrimination," Reagan said in his Inaugural Address four years ago. "We can have a strong prosperous America, at peace with itself and the world."

Reagan went only so far toward these goals. What he has put in place he now wants to cement there; what he failed to do in his first term he intends to try again. The accomplishments he wants to preserve are the economic recovery, the tax cuts and the military buildup. "The idea is to get it clenched and in place," he said.

The biggest leftover business is the $200 billion annual federal deficit and negotiations with the Soviet Union on arms reductions. The one new item on the agenda is reforming and simplifying the tax code.

At the outset, the second-term powerhouses appear to be Secretary of State George P. Shultz, with national security affairs adviser Robert C. McFarlane increasingly influential; Defense Secretary Caspar W. Weinberger; Treasury Secretary-designate James A. Baker III, and the new White House chief of staff, Donald T. Regan. All but Weinberger are ex-Marines.

Those who work closely with Reagan expect him to change little in his approach to the people and problems of another term. "I haven't changed my views since I've been here," he said last week in an interview with Ann Devroy and Johanna Neuman of USA Today. Reagan said he was frustrated by reports that aides tug him back and forth. "I'm too old and stubborn to put up with that," he said.

But in the last two weeks, Reagan again demonstrated that he feels most comfortable with a delegated presidency, allowing two of his most powerful assistants to work out their own job-swap, telling him only when a deal was struck between them.

Reagan got more involved in making budget decisions this year than any time in the past, according to aides, going over the entire document line by line, making specific choices about what to cut from each program. But he did not like it.

"We've been putting in long and bloody hours on this budget matter," he said.

Instead, Reagan shows a thirst for the work of selling his program. He has devoted many hours since the New Year's holiday to writing and polishing the inaugural message in longhand on yellow legal pads, presidential aides say. Next week, he resumes his regular Saturday radio address, and more speeches and campaign-style appearances will follow.

"Quite obviously, people like what they see and hear from him," the incoming White House chief of staff, Donald T. Regan, said in a recent interview. "He will leave his mark on American history by what he does over these next four years, and it would seem to me that the man would be well served to communicate these ideas so effectively to the American people that they would be enacted in legislation so he could leave his mark."

Where does Reagan intend to leave that mark? More than a dozen White House officials, veteran Reagan advisers and members of Congress offered these conclusions: The Economy

Reagan started by fighting inflation. It took a punishing recession in 1981-82, and sagging world oil prices, to help wring out the inflationary fever of the late 1970s. But now that inflation seems to have abated, Reagan's attention will be devoted to keeping the recovery going, and tackling the biggest failure of his first term -- the deficit.

Martin Anderson of the Hoover Institution, a former White House domestic affairs adviser who helped shape Reagan's first-term program, said the deficit was never Reagan's foremost concern; rather, it was economic growth without inflation. "I can get rid of the deficit tomorrow with a $200 billion tax on the American people. But it would devastate the economy," Anderson said.

With that same argument, Reagan has also stood fast against tax increases. The second term may see a more concerted effort to trim what Office of Management and Budget Director David A. Stockman calls "the six sob sisters of subsidy" -- government benefits for big business, small business, farmers, transportation, local government and federal credit. Reagan will resist defense cuts, but Congress will make them.

Reagan's next budget will include a $180 billion deficit, which assumes that he can persuade Congress to cut $50 billion in spending. Reagan acknowledged last week that "I almost have to be" resigned to going down in history as having presided over the biggest deficits in American history.

But Reagan faces powerful pressures from within his party to tackle the deficit now, particularly from Senate Republicans; 22 of them face reelection in 1986. The impetus is "bolder than anything I have seen" in recent years, said Sen. William L. Armstrong (R-Colo.)

The lesson of the last few years is that Reagan will be led into compromise with his Senate allies, then confront opposition House Democrats.

The surprise of the second term may be a Reagan push to win ratification in the states of a constitutional amendment requiring a balanced federal budget.

Inflation is no longer the threat it was; now Reagan will be watching out for the next recession. "I think you're going to see a change from anti-inflation to anti-unemployment" policies, said economist Lawrence A. Kudlow, a former administration official. "The unemployment rate is going to become more of a talking point in the next year or two. It has stopped falling, and 7.2 percent is nobody's definition of full employment."

Should the economy begin to falter, the Reagan White House is likely to try and shift blame to the Federal Reserve Board; privately, officials were testing this line in December when it appeared growth was slowing down. Another possibility for the second term: an effort by the White House to restructure the Fed to make it less independent. Tax Reform

Reagan has long preached the virtues of lower individual tax rates, and this remains his motivation in seeking a massive overhaul of the federal tax code.

Four years ago, he came to office when tax burdens were hitting record-setting peaks. A major tax cut seemed overdue; Reagan won a three-year, across-the-board tax cut, new tax breaks for business and "indexing" of tax rates to stop inflation from pushing people into higher brackets.

Now, Reagan wants to bring individual rates down further. He would accomplish this through a series of trade-offs: the elimination of many deductions in exchange for a modified "flat tax" at lower rates. A recent Treasury Department proposal along these lines won plaudits from unexpected quarters, including Ralph Nader and Common Cause.

Is Reagan ready to endorse this kind of tax reform? He initially balked at some aspects of the Treasury proposal that would strike at the heart of his Republican constituency. But he will use his State of the Union address to make a strong pitch for the concept next month, without embracing a specific plan. Incoming Treasury Secretary Baker will take the lead in hammering out a bill with Congress.

Lurking behind tax reform is the prospect that it could become the vehicle for a back-door tax increase.

"Some members of Congress feel, why go through the pain and anguish and travail if we don't come up with more revenue to deal with the deficit?" said Senate Minority Whip Alan Cranston (D-Calif.)

But Cranston added, "Reagan campaigned against a tax increase and won; [Walter F.] Mondale ran for it and lost. Many in the Democratic Party feel it was the major blunder of Mondale's campaign -- and that's where we now are. Unless Reagan decides we need a tax increase, Congress is not going to impose one over his objections."

Reagan accepted four tax increases in his first term. He is likely to agree to more in the second, probably disguised as "loophole closing," but will demand big domestic spending cuts from Congress as the trade-off. The Arms Race

Reagan brought to office the notion that a major expansion of the United States military and a hard-edged view of Soviet intentions could combine to produce stability between the superpowers. With help from Congress, his defense budgets subsequently outstripped even what he had promised in 1980.

A new era of East-West tension dawned, Reagan's first-term efforts at negotiation on nuclear missiles went nowhere, the Soviets shot a Korean airliner out of the sky and two Soviet leaders died in office during his first term.

But Reagan quietly abandoned his "focus of evil" rhetoric, and, in the midst of the 1984 reelection campaign, tried to coax Moscow back to the table.

Today, insiders say Reagan has told them that arms reduction, not just arms control, is the foremost goal of his second term, his fondest hope for a place in the history books. Just as Richard M. Nixon went to China, Reagan, who built a political career on anticommunism, believes he alone is in the best position to bring home a deal with the Soviets that can be sold to the American people.

Some who were skeptical of Reagan's intentions last year are now convinced of his sincerity. "I think the effect of the campaign, and the facts of life in the world as he's focused on them more, have led him to the view that progress must be made," said Cranston, who ran for president last year on the central theme that Reagan had failed in arms control in his first term.

"The question is basically whether they will work out within the administration, let alone the Russians, a sound position that will have the wholehearted support of everyone. It's not apparent they have accomplished that," Cranston said.

A twist of uncertain consequence in the second term is Reagan's proposed antimissile defense system, the Strategic Defense Initiative, known as "Star Wars," designed to block incoming nuclear missiles. Even as U.S. negotiators begin discussions with the Soviets on limiting weapons in space, Reagan intends, at the outset of the second term, to try to make the case to the American people for the SDI.

"If there is anything to the Reagan revolution, that is going to be part of it," Anderson predicted. "If you talk to the American people about defense, they naturally believe in it." The Political Legacy

Reagan will never again run for office, but his place in the history books may depend on his political skills in the next few years. The election produced fresh evidence Republicans are making headway in their quest to become a majority party. But to really leave his mark, Reagan must succeed in cementing his political coalition for the benefit of his Republican successors.

"Obviously, when trying to put this coalition together, it is fragile at the begining, there are a lot of 'soft' people in it," said pollster Robert Teeter. "To a certain degree it is based on performance more than actual policy."

The coalition brings together traditional Republican conservatives, the religious right, working-class voters and a huge electorate of baby-boom, young voters. It is held together by a booming economy, but another recession might break it up, as did the 1982 slump. "The longer we can keep them," in times of prosperity, "the more we can keep them in bad times," Teeter said.

Outside the political arena, Reagan will get other chances to shape his place in history.

He may appoint three or four Supreme Court justices in a second term. Having based much of his political career on criticism of "activist" Supreme Court rulings on school prayer, abortion, school busing and the rights of defendants, Reagan could wipe out the court's remaining liberal wing.

His lone first-term appointment, Sandra Day O'Connor, underscored Reagan's desire to change the direction of the federal judiciary.

He may also wind up appointing more federal judges in two terms than did Carter, who presided over a major expansion of the bench. Reagan "holds as one of his highest goals" a philosophical shift in the federal bench and the appointment of judges who "believe as he does in judicial restraint," said Fred F. Fielding, the White House counsel.

Finally, Reagan may touch the lives of millions of Americans in a second term by seeking to free businesses like banking, trucking and telecommunications from government regulation. But other efforts to get government "off the backs" of business could be slow-going. His first-term goal of rolling back environmental protection laws may remain stymied, but Congress is likely to pass a new "Superfund" law for toxic waste cleanup.

The first-term argument over civil rights will continue, with Reagan arguing that many of the current remedies for discrimination need to be reexamined and the nation should move toward a "colorblind" society.

In his final term, Reagan also will be an advocate for the government to intervene in such issues as abortion and school prayer. A year ago, against the advice of his political aides, Reagan wrote a passage in a speech discussing the pain a fetus feels in an abortion. The aides wanted to suppress a politically divisive issue, but Reagan said it was one on which he had strong beliefs.

In a second term, unconstrained by another election, Reagan will probably be even more outspoken about these beliefs.

It is an important piece of symbolism in this direction that on his first full day in the Oval Office after the Inauguration, Reagan has decided to speak out against abortion at a rally near the White House.