President Reagan went to Capitol Hill last night and rallied the Republican majority in the Senate for the next two years of his term.

Reagan told the senators at the Republican Senatorial Dinner at the Library of Congress that, "We came to Washington with a confident vision . . . . We have creative ideas," while "the opposition, even after two years of complaining, and in some cases of obstructionism, has yet to offer anything other than the failed policies of the past."

But while urging the Republicans, in effect, to "stay the course," Reagan also said he will not be rigid.

Some GOP senators have privately connected Reagan's "stay the course" approach to sizeable losses by Republicans in the House in the November elections.

"And I can assure all of you, and Majority leader Howard H. Baker Jr. will attest to this, I am listening and I'm willing to go the extra mile to make certain we strengthen our partnership," Reagan said. "By controlling the presidency and the United States Senate, we have exceptional opportunities."

Reagan was particularly critical, as he has been before, of Democratic proposals for new large-scale jobs programs.

"The solution for unemployed auto workers and steelworkers is not a giant public works program financed by higher taxes or increased borrowing," said the president.

"America's challenge for the '80s is to invest more and to invest wisely, to make our workers and products more competitive in world markets, to unleash our pioneer spirit of innovation and get this nation back on the cutting edge of growth.

"Compared to other major industrialized countries, our rate of net private investment has been pathetically low. We've been eating our seed corn for more than a decade. . . . The new tax and spending increase proposed by the opposition won't stimulate the economy; they certainly won't reduce the deficit, and yet, that's all the other side has to offer."

Reagan began his speech by cheering the Republican senators for maintaining their majority in the Senate over the last two years.

He then mentioned that three Republicans will be leaving the Senate, S.I. Hayakawa (Calif.), Harrison H. Schmitt (N.M.), and Nicholas Brady (N.J.).