Garfield High School, a drab block of concrete in the middle of a low-income, Hispanic neighborhood in East Los Angeles, has been known for high absenteeism and youth gangs, but never for higher mathematics. Perhaps that is what fooled the Educational Testing Service of Princeton, N.J.

In the May 19 national advanced placement calculus test, which is so difficult that only 2 percent of graduating high school seniors ever attempt it, a startling total of 18 Garfield students passed. Many had similar correct answers and seven made the top score of five, what one Garfield teacher compared with "walking on water."

Sensitive to the slightest hint of invalid scores, the service, which composes the Scholastic Aptitude Test and other national examinations, demanded a retest for 14 of the students, but the results were the same. It had stumbled across, not a cabal of cheaters, but the students of Jaime Escalante, 51, a Bolivian immigrant who has performed a miracle in a tough, big-city school.

In the process, he also has shown what a rigidly organized classroom routine and a deep devotion to teaching might do to solve what is becoming a national crisis.

In the third decade since the Soviets put the first artificial satellite in orbit, science and mathematics in American high schools have fallen on hard times. Qualified teachers are quitting in droves for better-paying jobs in private industry.

In California, according to a recent study by University of California researchers James W. Guthrie and Ami Zusman, 750 science and mathematics high school teachers are retiring each year, but only 250 students in the state university system currently are training for such jobs.

Some school districts are trying to retrain athletic coaches to fill the gap, but students still graduate woefully ill-equipped for the new era of high technology, thus adding to the unemployment rolls at a time when high-tech jobs are going begging.

To motivate his students, Escalante uses a Spanish word, ganas, which loosely translates as "the urge" -- the urge to succeed, to achieve, to grow. It is difficult to teach, and impossible to legislate, but a look at one remarkable teacher can show how it grows and the forms it comes in.

Garfield High School sits five miles east of downtown Los Angeles, drawing students from long, flat blocks of small stucco and frame houses, the homes of middle- and lower-income families, almost all of Hispanic descent. The community, said principal Henry Gradillas, "does not have that great love for education. They have large families, they have to go to work, they start families early."

Escalante's routine includes a five-minute test at the beginning of every class. He insists that homework be done; he has taped the assignments for the whole year into each textbook so no one can claim forgetfulness. His tests are long and difficult, and after-school work is usually a must.

Escalante came to the United States in 1964, with 11 years' experience as a teacher in Bolivia. But he could not speak English well and could only find a job as a busboy in a Pasadena restaurant. Within six months he had been promoted to head cook. He studied electronics in his free time at Pasadena City College and soon won a job with the Burroughs Corp. as a technician. The money was good, "but I hoped to go back to school and teach again."

When a friend told him of a possible National Science Foundation scholarship, he applied, and scored first in the qualifying examination in mathematics, physics, chemistry and English. After a year of courses at California State University at Los Angeles, and at Fullerton and the University of Southern California, Escalante had his teaching credentials. Local school officials asked him if he wanted to teach "Anglos, blacks or Chicanos." He picked Garfield.

That was in 1974. The school had not had anyone pass the advanced placement calculus test for several years. As Escalante worked his way to higher responsibilities in the mathematics department, eventually becoming chairman, he treated the 3,000-member student body as if it were a farm club for the Dodgers. He kept asking other teachers: "Do you have any kid who could do calculus? Do you have any stars?" Those with potential he brought into his classes, then loaded them down with special assignments.

Students who reject the system, who refuse to try to learn after repeated chances, usually are ejected from Escalante's class. Earnest but slow learners are moved to desks near Escalante's desk and receive his after-hours attention: personal tutoring before school, at lunch and after school. He withdrew from his desk several cans of fruit juice and soft drinks and a plastic bag full of breakfast cereal--all gifts from students who worried that he might be missing a meal.

By 1979, Escalante's efforts began to bring results. In that year, four Garfield students passed the advanced placement calculus test, giving them a full semester of college credit. Eight passed in 1980, and 14 passed in 1981. As this year's test date approached, Escalante was driving the 18 students who would take the test like a well-disciplined team of show horses. They were doing two hours of work at school and two hours after school, solving at least 30 problems a day.

He worked so hard that three weeks before the test he suffered a heart attack. He was hospitalized for a week, defying his doctor's orders by making up more problems in his hospital bed and sending them over to his class.

"He devoted a lot of time, so much time, all unpaid," said Josie Richkarday, the one junior in the group. "He asked nothing in return."

After passing the test, Escalante's students graduated, bound for college careers at Columbia, Berkeley, UCLA, and other schools. Most hope to pursue careers in engineering or computers. The news in August that the Educational Testing Service was questioning their scores angered them, but did not appear to sidetrack them.

Escalante, Gradillas and the students said they all felt that the testing service had questioned the scores because they came from a low-income, Latino school.

Joy McIntyre, a spokeswoman for the service, strongly denied this. She said that the tests were scored by people who did not know the names or origins of the pupils who took the test, and the decision to ask for a retest was based on statistical calculation of the likelihood of so many similar answers.

"We're selling a service, which depends on the fact that there are no doubts about the validity of our scores," said McIntyre, and Escalante said he could see the service's point.

Aili Tapio, who turned down Harvard so that she could enter the University of Southern California as a sophomore, said that Escalante told his students: "You know, in the end, you're going to have to take it again."

Tapio said that she and the other students received only a week's notice of the new test in late August. All of them passed a second time except two, one of whom already had joined the Army. The other had already enrolled at Columbia.

This year, Escalante plans an even grander assault on the calculus test. He says that the Educational Testing Service should be warned.

"I've got 42 calculus students this time," he said. "I expect at least 35 of them will pass."