In a city that often takes its politics emotionally, Tuesday's mayoral election seems destined to go down as a classic.

The candidates, incumbent Paul R. Soglin, 31, and Anthony Amato, 25, are former student activists whose rivalry dates back to the early 1970s when Amato was business manager and campus ediotr for a conservative student newspaper and Soglin wrote a column for a radical student paper.

The ideological differences that separated them in their student days have contiued into their student days have continued into their careers in local politics and are the focus of the mayoral race.

Amato ran first in a six-man primary Feb. 15, taking 16,557 votes to 12,941 for Soglin, who finished second. But Soglin did not campaign hard in that race, and several polls show him with a substantial lead going into Tuesday's balloting.

Soglin was elected mayor four years ago after five years as an alderman representing a largely student district near the University of Wisconsin here. Tagged as a radical during his aldermanic days, Soglin had to move toward the center a bit to defeat his conservative predecessor, William Dyke.

But Soglin has not shed his radical image altogether. Re-elected easily in 1975, he traveled to Cuba twice during his second term, once on a "goodwill" visit and once on vacation.

Amato, an ardent supporter of Dyke in 1973 and a member of the city council since 1975, has pounced on these trips as symbolic of the "radical" mayor who, he says, gives the city a bad name.

He has focused particularly on the growth of the commercial sex business in Madison. While Soglin has not put a particularly high priority on cracking down on commercial sex. Amato has put himself in the fore-front of a "clean up Madison" drive.

The issue has been gaining strength over the past three years with the movement of massage parlors and adult book stores into semiresidential areas.In 1975 a referendum to tighten controls on massage parlors was approved.

The two men have had a series of emotional clashes at numerous forums and televised debates, with Soglin at one point saying that businessmen who contributed to his campaign had a "social conscience" while those who backed Amato did not.

A group of Amato supporters has attended numerous forums and heckled Soglin. At the end of one forum before a labor group, an unidentified Amato supporter approached Soglin, who is Jewish, and shouted, "Heil, Hitler."

One night Amato was interrupted at a forum by a trio singing a song mocking him. He has refused to release his campaign schedule in advance to try to thwart potential hecklers.

Amato has been on the defensive during the campaign over allegations that he and his family have organized crime connections.His father is a first cousin by marriage to an individual who Justice Department reports have identified as a leading organized crime figure in Milwaukee, but Amato responds, "I could not pick and choose my relatives.

"I guess because you have a macaroni last name and you get involved in politics, everyone says, 'Aa, Mafia.'"