Viewed from this centuries-old battleground between France and Germany, Europe has reasons for both pride and disappointment as it celebrates the 40th anniversary of the end of World War II.

It is, in some ways, a unique commemoration, perhaps the last of its kind. In 10 more years, there will be far fewer people to mark the 50th anniversary who remember this continent as it once was under the grip of Hitler's Third Reich from 1939 to 1945.

Today's Europe, its culture and institutions, is largely a creature of that war. Next week, an American president, Ronald Reagan, will make what has become a routine visit to the capital of West Germany to meet in an economic summit with the leaders of six other industrialized nations, three of them former enemies: Germany, Italy and Japan.

Here in Strasbourg, the main cause for celebration is summed up by Marcel Rudloff, the city's 62-year-old mayor, who witnessed the Nazi annexation of Alsace in 1940 in revenge for its capture by France in World War I.

"For generations, we Alsatians thought war was inevitable," he mused. "Today a war -- or at least one started in this part of the world -- has become unthinkable. This achievement overshadows everything else."

Once regarded as one of Europe's most sensitive flash points, this cathedral city on the Rhine is now rightly seen as a symbol of postwar peace and reconciliation. The European Parliament here will provide President Reagan with an appropriate setting for a major address on V-E Day, May 8 -- a speech already being billed as one of the highlights of the president's forthcoming West European tour.

But as the embryonic capital of a "United States of Europe," a project that never got past the political drawing board, Strasbourg is also a symbol of the frustrations and nationalistic divisions of a once-mighty continent. Stripped of their colonial empires and ultimately dependent on the United States for their collective security, the nations of Western Europe still are engaged in an unfulfilled search for identity in a world dominated by the two superpowers.

"We have gone as far as we can with the present political structures," said Altiero Spinelli, a former Italian resistance fighter widely regarded as one of the fathers of the European Community. "The number of problems has increased, but Europe's ability to solve these problems has diminished. Now we have to try something else."

Western Europe today bears little outward resemblance to the devastated continent liberated from Nazi occupation four decades ago. Its cities, factories, railroads and highways have been rebuilt. Vast numbers of peasants have migrated from the countryside to the towns, and so-called "economic miracles" have been wrought in countries as diverse as West Germany, France, Italy and Spain. Rising Living Standards

Standards of living have risen everywhere, in some cases catching up with those in the United States, to the amazement of older Europeans who recall what a struggle it was simply to find enough to eat in the immediate postwar period.

"Take a look at our economic crisis," joked Daniel Riot, a journalist for the Strasbourg newspaper, as he flung open the door on a crowded beer parlor. Every seat in the room was taken -- and waitresses bearing plates of choucroute and other Alsatian delicacies scurried among prosperous-looking clients.

For all the talk of economic setbacks in the 1970s, and a decline in industrial competitiveness in relation to the United States and Asia, Europeans live very well indeed. Even the growing army of unemployed, which has doubled to 12 percent during the past five years, has been cushioned from the brunt of the crisis by generous social welfare benefits.

And yet -- perhaps paradoxically in view of all this material progress -- Europeans seem less optimistic than they were in the years immediately after the war. The postwar "baby boom," the ultimate expression of confidence in the future, is long since over. Political leaders now worry about declining birthrates and aging populations.

"After the war, we had no choice except to be optimistic. We knew that, after all we had experienced, life could only improve," said Mayor Rudloff who, after fleeing Strasbourg in 1942 to avoid being drafted into the German Army, returned in 1946 to find his hometown heavily damaged by American and British bombs.

He added: "We were convinced that our children were going to be better off than we had been. The present generation is by no means so sure about this."

Part of the reason for today's pessimistic outlook is the failure of European politicians to generate enthusiasm for the ideal of a united Europe. There is a feeling, both in France and West Germany, that Western Europe took a fateful turn in the late 1950s, when Gen. Charles de Gaulle called for a "Europe des patries" -- a Europe of individual sovereign states -- rather than the federal structure that idealists such as Spinelli had been advocating.

"We dreamed of a United States of Europe that would be a real partner for America and an economic match for Pacific countries like Japan," said Hans Stiff, the publisher of a newspaper in a major West German city, recalling how he took part in pro-Europe demonstrations in the '50s in Strasbourg. "De Gaulle put an end to that idea."

Ironically, these days, the loudest calls for faster European integration are coming not from West Germany but from France. French politicians such as President Francois Mitterrand see a strong European Community as a means of anchoring a potentially wavering Federal Republic of Germany firmly in the West as well as competing more successfully with America. Signs of Integration

Progress toward European integration has been impressive in some areas, painstakingly slow in others. Symbolic of both trends are the booming sales in border regions such as Alsace of dual-standard television sets capable of tuning into the French color television system, which is known as Secam, as well as the rival German PAL system.

Border controls between France and West Germany, as between other member states of the 10-nation European Community, are practically nonexistent. A 50 cent ride on a number 23 bus from Strasbourg to Kehl across the Rhine is all it takes to travel from France to West Germany.

"Crossing the frontier has become so banal that nobody regards it as a privilege any more," remarked Jaque, who said he recently drove from Strasbourg to the Netherlands without once showing his passport.

During the opera season in Strasbourg, busloads of West German tourists descend on the city. Pop concerts in Mannheim or Karlsruhe on the other side of the Rhine attract hundreds of French students, who cross the frontier -- which in the 1930s bristled with a network of supposedly impregnable military fortifications known as the Maginot and Siegfried lines -- without giving it a moment's thought.

Constructed as a joint investment by three countries, Strasbourg Airport caters to passengers from France, West Germany and Switzerland. The city is at the hub of a highway system that stretches across Western Europe, but political obstacles still prevent the opening of a joint river port on the Rhine with the neighboring town of Kehl.

The negative side of European integration is reflected in the experiences of industrialists like Alsatian master brewer Michel Defus, who cannot sell his beer in Germany -- just five miles down the road -- because of protection legislation dating to 1516, and the seemingly endless arguments about the price of pork or milk that dominate meetings of European political leaders.

To Debus, "Europe doesn't exist," because of such protectionist measures that have undermined the goal of a truly "common" market of 250 million people able to compete with the United States and the newly emergent nations of the Pacific.

So far, institutions such as the European Parliament in Strasbourg or the executive Commission of the European Community in Brussels have lacked the political clout to break down entrenched national interests.

The goal of a common defense system for Western Europe, which seemed attainable in the '50s, when the European Defense Commmunity was set up, has receded into the distance. The taboo on Germans ever possessing nuclear weapons has been maintained, and Europeans have not even been able to agree on a common caliber rifle. In a war against the Soviet Union, noted university president Jean-Paul Jacque of Strasbourg, French and West German soldiers would not even be able to share each other's ammunition.

Coinciding as it does with a debate on this side of the Atlantic about how to respond to the American strategic and technological challenge posed by the "Star Wars" space-defense project, President Reagan's visit to Strasbourg will underline the changes in relations between the United States and Western Europe during the past four decades.

"Everything was much simpler in 1945," said Philippe Moreau Defarges of the French Institute for International Relations in Paris, "Western Europe was poor, it had been ravaged by war and it did not have any choice except to seek assistance from the United States."

To the obvious need for economic reconstruction was added a new fear of the Soviet Union, easily the most powerful military power on the European continent following the defeat of Hitler's Germany. Both pressures combined to force the new postwar states of Western Europe to turn to Washington for help.

The Truman administration responded with the Marshall Plan -- under which more than $13 billion was distributed to 16 European nations from 1947 to 1950 -- and Dean Acheson's policy of containment.

Relations today are much more ambiguous. Europeans both need the security umbrella provided by the United States and resent American economic and political dominance. France has taken the lead in trying to persuade other West European governments to respond collectively to individual U.S. invitations to take part in the research phase of Reagan's Strategic Defense Initiative, more popularly known as "Star Wars."

"Europeans gradually are discovering that they must live together, as the United States has other interests elsewhere. Europe is condemned to becoming an adult," Moreau Defarges added.

For their part, Americans agree that Europeans should do more to help themselves but are wary of independent European defense or foreign policy initiatives. There are advantages for Washington in being able to deal with European nations individually rather than collectively -- a preference reflected in a State Department letter earlier this year urging Western European governments not to reach a common position on arms control matters outside the framework of the Atlantic Alliance.

On both sides of the Atlantic, there is confusion over whether Western Europe should be regarded as a partner, a competitor or a protectorate of the United States. Coordinating Research

Past attempts to meet the technological challenge posed by the United States by coordinating scientific research in Western Europe have met with only limited success. The practical problems involved are reflected in the almost incredible statistic that there are more French scientists working in California than in all the other nine countries of the European Community combined.

"As far as scientific research is concerned, it seems that the Rhine is wider than the Atlantic," said Jacque of the University of Strasbourg. "Scientific information circulates badly here. Frequently, it is easier to find out about what is happening in the United States than in the rest of Europe."

Together, European governments spend more on scientific research than either Japan or the United States -- but without nearly as great a return. Research projects in one European Community country are frequently duplicated in another.

For supporters of the European Parliament, a body that has wielded little real power until now, Reagan's decision to address the assembly on V-E Day is significant because it amounts to U.S. recognition of a European identity greater than the sum of the squabbling nation states.

"By coming here, Reagan is in effect recognizing an embyro of Europe. He will be addressing the people of Europe, not the 10 individual governments," said Jacque, who acts as a technical adviser to the parliament.

After the last war, Spinelli reminded a group of political activists who met in Paris last week to discuss the future of Europe, all the great European nation-states with the exception of Britain were discredited. Nazi Germany and fascist Italy had suffered devastating defeats. France under Marshal Henri Petain, leader of the Vichy administration, stood accused of collaboration with Hitler.

One by one, the nations of Europe began to rediscover their history and identity. The process occurred first in France under de Gaulle, who acted quickly to rebuild his country's lost sense of honor by stressing its independence. It is still incomplete in West Germany, as the emotions stirred up by Reagan's proposed visit to a German military cemetery has made plain.

The differences in the intellectual climate on either side of the Rhine are striking. When the local newspaper in Strasbourg organized a debate between West German and French left-wing intellectuals awhile ago, heated arguments broke out over the deployment of U.S. missiles in Western Europe -- with the French in favor and the Germans against.

"I guess that we would also be anti-American if there were American military bases here," said Riot, the journalist, recalling that the issue of U.S. military personnel in France was settled in 1966, when de Gaulle demanded their expulsion. "We have to understand the Germans; they lost half their country during the last war. Think of how much we French complained when we lost Alsace." A Generation Gap

Across the West German border in the city of Saarbruecken, attitudes toward America and Europe seemed to reflect a generation gap between older people who experienced the shock of the total destruction of their nation during the war and younger people worried about the "artificial" nature of the modern Federal Republic.

"The younger generation doesn't know what the Americans did for us -- and this explains their anti-Americanism. They don't understand how this country came to be rebuilt. Without American troops, there would have been no freedom," said Stiff, 62, the publisher of the Saarbruecker Zeitung who said he was captured by the Red Army in Czechoslovakia in 1944 but later managed to escape and walk back home across a war-torn continent.

Werner Kern, the newspaper's chief reporter who is in his forties, disagreed with his boss about the extent of anti-American feelings in West Germany. Noting that there was a big difference between rhetoric and practical politics, he said that younger people merely were asking legitimate questions about the future of their country.

One political trend common to all of Western Europe since World War II has been the steady decline of communist influence. Only in Italy has a powerful Communist Party managed to survive at the price of virtually transforming itself into a western-style socialist party ideologically hostile to the Soviet Union.

In Alsace, the Communist vote in national elections has declined from more than 10 percent in the immediate postwar period to little over 2 percent today. The fact that large numbers of Alsatians forced to serve with the German Army on the eastern front ended up in Soviet prison camps effectively destroyed the Communist Party's chances in the region as early as 1945 -- but much the same trend is visible in the rest of France.

As Andre Glucksmann, a French writer and philosopher, noted: "After the war, workers in Western Europe were red. Now one has a situation in which they have become believers in bourgeois virtues -- and their comrades in Eastern Europe are dying for a chance to live like them."

With the postwar reconciliation between France and Germany, the European political fault line has shifted away from the Rhine to the Elbe, where Soviet and American soldiers met up in 1945. The division of the continent into East and West reflects the political and military weight of the two superpowers.

"The four decades since the end of the war have witnessed an ideological victory for the West -- but a political victory for the Soviet Union," Glucksmann added. "There's practically nobody left in Western Europe who regards Soviet-style communism as a worthwhile political model. But the West has acquiesced in the Soviet domination of Eastern Europe against the wishes of the local population."

In the dark days of 1940 and 1941, when most of Europe had succumbed to Nazi tyranny, Strasbourg came to be regarded, by de Gaulle and his "Free French" forces, as the symbol of France's humiliating defeat. New recruits were required to swear not to lay down their arms until the French tricolor "flutters once again from Strasbourg cathedral."

The emotional significance of Strasbourg for the "Free French" reflected Alsace's unique position at the crossroads of French and German culture. The epitome of a frontier land, Alsace was part of the German empire for seven centuries up until the end of the Thirty Years' war in 1648. It was then French until 1870, German until 1918, French again until 1940 and German during the second World War.

Alsatians have the reputation of speaking French with a German accent -- and German with a French accent. They pride themselves on their attachment to French democratic ideas and German efficiency and thoroughness. Many of the region's 1 million inhabitants have French first names and German surnames.

"This is German France," said Jean-Pierre Klein, curator of the history museum in Strasbourg, who added that Alsace is also the meeting point of the wine and beer cultures.

In the center of Strasbourg, an elegant town that combines German and French architecture in the shadow of the Gothic cathedral with its soaring spire, people can be heard chattering away in half a dozen languages. A recent demonstration by European railroad workers against unemployment that ended up outside the headquarters of the Council of Europe drew protesters from West Germany, Britain, Austria, Belgium, Denmark, the Netherlands, Italy and Luxembourg.

"Strasbourg cannot exist culturally or economically without Europe. We cannot be just a fortified outpost of France," said university president Jacque, pointing out that 35,000 residents of Alsace go to work every day in West Germany and Switzerland.