U.S. special ambassador Sol Linowitz ended a six-day Middle East trip today, sounding a note of unexplained optimism that the moribund negotiations on West Bank and Gaza Strip autonomy can lead to an agreement by the May deadline.

"I'm encouraged by this trip, heartened by the feeling of commitment that I found here and in Egypt, and I think we can look forward to progress in the months ahead," Linowitz said after the last of a series of meetings with Israeli and Egyptian leaders here and in Cairo.

Linowitz, accompanied by Israel's chief negotiator, Interior Minister Yosef Burg flew to Cairo yesterday for a 70-minute meeting with Egyptian Prime Minister Mustafa Khalil and then returned here for a brief session with Israeli Prime Minister Menachem Begin before heading for Washington. w

As he has since the outset of the trip, his first in the region since being named to head the U.S. delegation, Linowitz repeatedly spoke of "real progress" in his talks, without being specific as to its nature. But sources close to the negotiations said that in the private meetings there was a greater sense of urgency expressed by all of the participants that the time has come to tackle substantive differences instead of concentrating on procedural issues, as working committees have been doing.

Officials said that both Egypt and Israel have agreed that issues such as the source of authority of the proposed Palestinian autonomous council and the status of East Jerusalem must be dealt with as soon as next week's ministerial level talks in Cairo or it is unlikely that May 26 deadline for of agreement on elections can be reached.

At the same time, sources close to Begin say that Israel will not consider it catastrophic if the deadline is not met, and that the talks could continue into the summer.

So far, not one significant Palestinian political figure has indicated a willingness to participate in the autonomy plan. But during his visit, Linowitz stressed that he is not discouraged.

"We must answer the Palestinians' question of "What's in it for me?' That's the challenge we have to meet," Linowitz said. He indicated this could only be done through painstaking and methodical negotiating that leads to cumulative progress of seemingly small dimensions rather than "dramatic, headline-making" progress.

"Anybody involved in negotiating realizes that this must happen, and it is happening," he said.

Meanwhile, some West Bank mayors denied reports published here and in Cairo that the chief Egyptian delegate to the autonomy talks, Ahmed Izzat Abdul-Latif, had held secret meetings with West Bank and Baza leaders over the autonomy issue.

Bethelehem Mayor Elias Freij, a moderate, branded the reports as false, saying the Palestinian leaders were unified in their refusal to discuss autonomy with either Israel or Egypt. Freij reiterated the mayors' position that the Palestine Liberation Organization is the sole representative of Arabs in the occupied territories.