The mixture of applause and protests that greeted President Reagan at the European Parliament here today reflected Western Europe's deep ideological divisions 40 years after the end of World War II.

The chamber, in which parliamentarians sit according to their political affiliation, split neatly into halves. Deputies on Reagan's right burst into loud clapping every few minutes while deputies on his left heckled, read newspapers, or sat in disapproving silence.

Tactical divisions within the ranks of leftist members of the parliament, Europe's first directly elected assembly, were reflected in the walkout that occurred in the middle of Reagan's speech after he mentioned Nicaragua. About 30 British Socialists, several West German and Belgian pacifists, and some French and Greek Communists left.

The large contingent of France's ruling Socialists, who disagree with Reagan's policy toward Nicaragua but have generally supported his tough line toward the Soviet Union, remained firmly in their seats, as did the Italian Communists and the West German Social Democrats.

"The reception given to Reagan reflects the diversity of political opinions in Europe. Unanimity exists only in totalitarian regimes," said Pierre Pflimlin, French president of the 10-nation, 434-member parliament, in an attempt to put the best possible face on the protests.

Even by standards of Western Europe, where there is considerably more parliamentary rough-and-tumble than in the United States, today's reception for Reagan was unusually noisy. The only precedent officials could recall was a visit of the late Egyptian president Anwar Sadat in 1981 when Italian radicals held up banners accusing him of betraying the Palestinians.

The Reagan visit provided a rare opportunity for the European Parliament, a largely powerless body, to attract media attention. Members on both sides seemed genuinely pleased that someone was taking them seriously for a change.

Members of the European Parliament's Group for Nuclear Disarmament, which led the protests, claimed that the demonstrations exceeded their expectations. Well over 100 deputies held up posters with such slogans as "Star Wars No," and "Hands Off Nicaragua."

"We succeeded in getting our message across and putting Reagan off his stride," said Leslie Huckfield, a left-wing member of the British Labor Party, dressed like many of his colleagues in a red T-shirt emblazoned with antinuclear symbols.

Later, jubilant British Socialists insisted that the walkout had been "a totally spontaneous reaction" in response to "a rabid Cold War speech."

Rightist delegates praised Reagan for the way in which he produced ripostes like, "Is there an echo in this room?" when the protesters chanted, "Nicaragua, Nicaragua."

"These minor and insignificant incidents were dealt with very well by the president. He showed that he has a great sense of humor and repartee," said James Scott-Hopkins, a British Conservative.

Among those who did not take part in the walkout, opinions were mixed about the protests and Reagan's speech. While some felt that the demonstration was undignified, others said that the U.S. president could only benefit from being exposed to other points of view.

Simone Weil, prominent French centrist and former president of the parliament, described the reception given Reagan as fully in accordance with parliamentary traditions.

"Reagan himself profits from our divisions in Europe and turns them to his advantage. He therefore cannot complain when we demonstrate that we are divided. This is parliamentary democracy," she said.

A different view was taken by Jacques Delors, president of the European Commission. Addressing the Parliament after Reagan left, he said the issue facing Europe was whether it wanted to be a real partner of the United States or "ride on the coattails of Uncle Sam."

Appealing for greater coordination between European countries on countering the U.S. technological challenge, he said: "Europe doesn't gain anything by just protesting. You have to fight for the things you want in life."