President Reagan ended his difficult five-day visit to West Germany today with an upbeat address to German youth as White House officials said he is prepared to ask the new Soviet leadership to reconsider four previously rejected or ignored U.S. proposals to reduce superpower tensions.

As the president left here for a 41-hour visit to Spain, national security affairs adviser Robert C. McFarlane said Reagan, in a speech to the European Parliament in Strasbourg, France, on Wednesday, would renew his offer to join the Soviets in a declaration that both nations would not be the first to use military force.

Issues affecting East-West relations, especially the questions of Spanish participation in NATO and U.S. bases in Spain, were expected to figure prominently in Reagan's discussions with officials in Madrid, where he arrived Monday afternoon. The government of Prime Minister Felipe Gonzalez has been under pressure on these issues in recent days, and especially during the weekend when tens of thousands of anti-U.S. demonstrators took to the streets of Spanish cities.

In Strasbourg, Reagan will condition his offer on the Soviets accepting "concrete measures" to enforce it, as he has in the past, McFarlane said, adding that the president also intends to renew a proposal for exchanging observers at military exercises.

He said Reagan will propose regular meetings between Defense Secretary Caspar W. Weinberger and his Soviet counterpart and intends to renew a proposal made last year for improved communications links between military leaders in Washington and Moscow that could be used to prevent such crises as the downing of a South Korean airliner in 1983 and the recent killing of a U.S. Army officer in East Germany.

Beyond these specific proposals, Reagan also intends to reiterate his call for the "reunification" of a divided Europe, McFarlane said, and may suggest that a relaxation of travel restrictions could ease tensions between East and West.

Reagan, in his final appearance in West Germany today, did not mention the Soviet Union directly, but he urged German youth to look forward to the day when Soviet domination of Eastern Europe gives way to democracy.

"Europe today -- divided by concrete walls, by electrified barbed wire, and by mined and manicured fields, killing fields -- it is a living portrait of the most compelling truth of our time. The future belongs to the free," Reagan said.

The speech today came in the setting of a campaign-style pep-rally before about 6,000 young people at Hambach Castle, a restored 11th century mountain citadel known as the birthplace of German democracy. Reagan was applauded 40 times by the young crowd, which officials said was drawn from pro-American youth groups in West Germany and the youth federation of West German Chancellor Helmut Kohl's Christian Democratic Union.

Reagan's appearance was an upbeat counterpoint to the solemnity of Sunday's visits to the Bergen-Belsen death camp site and the Bitburg German military cemetery. Those followed a contentious seven-nation economic summit in Bonn.

Reagan delighted the young crowd by saying in German, "Mein Herz ist mit Ihnen. Gottes Segen" -- "My heart is with you. God bless you." He added, "Wir fuehlen ganz hier zu Hause," -- "We really feel at home here."

"The cause of German unity is bound up with the cause of democracy," he said. "As Chancellor Kohl said in his state-of-the-nation address last February, 'Europe is divided because part of Europe is not free; Germany is divided because part of Germany is not free.' And Germany will only be complete, Europe will only be united, when all Germans and all Europeans are finally free."

"Nothing could make our hearts more glad than to see the day when there will be no more walls, no more guns to keep loved ones apart," he said.

But Reagan also warned that German reunification is not likely to come soon, and he asked the youths to remain committed to "the cause of freedom." Reagan aides said Kohl had asked the president to make the youth address.

"The first frontier of European liberty begins in Berlin, and I assure you . . . that America will stand by you in Europe and America will stand by you in Berlin," Reagan said.

The White House told reporters about the contents of Reagan's Strasbourg speech as the president left West Germany for Spain.

White House spokesman Larry Speakes said Reagan is making the proposals now to "stimulate interest" by new Soviet leader Mikhail Gorbachev and to take advantage of the European forum.

McFarlane said in an interview today that the four proposals have "languished" and Reagan felt the time had come to "elevate them to his level" just before the May 15 meeting between Secretary of State George P. Shultz and Soviet Foreign Minister Andrei Gromyko in Vienna. Another senior official said that while the Soviets had shown no interest in the proposals previously, "maybe now they are ready to accept."

McFarlane has played a major role in shaping the Strasbourg address and sought to include more specific proposals in it, directed at Moscow, than were included in earlier drafts, this official said.

The speech is also expected to discuss Reagan's proposed Strategic Defense Initiative for ballistic missile defense, which he said today may someday "demilitarize the arsenals of the Earth."

Support for the U.S. research program has been mixed in Europe. France last week rejected Reagan's offer to participate, while West Germany remains open to possible participation.

The no-first-use declaration had been proposed many times before by the Soviets but rejected by the United States on grounds that it would have little value, could not be enforced, and might lull the West into weakened defenses, McFarlane said.

Last June, however, in an address to the Irish parliament, Reagan broke with his previous position and said he would "gladly" consider a no-first-use declaration. But he said it would have to be conditioned on the Soviets agreeing to specific measures under discussion at the Stockholm European security conference "which will give concrete new meaning" to the declaration.

Such measures would be improved Moscow-Washington communications links and exchanging additional military observers. Since then, U.S. and Soviet officials agreed to upgrade the hot line between political leaders, but did not move on a U.S. proposal for an improved military hot line.

Officials said the Soviets had privately shown the most interest in the military-to-military communications link, probably a telephone hook-up. But they also noted that Moscow had shied away from public discussion about improving such hot lines while the two superpowers were not at the nuclear arms negotiating table in late 1983 and 1984.

"Now that we're back at the table there are some things they were eyeing that could now be a basis for agreement," a White House official said.