Learning mathematics in the Israeli junior high school has become a serious problem in the education system in the last 20 years. In Israel the learning of high level mathematics is a condition for being accepted to any high prestige university department. Thus it is crucial to learn what are the educational, psychological and motivational components involved in the learning of mathematics. I have examined these components in grades 7, 8, 9, and 10 of a secular, mixed Jewish school; religious school with single-sex classes; secular mixed Arab school, and Arab girls' school, among 800+ students. The most important results of my study have been that there is no gender gap in school performance of math in the Israeli junior high school; motivational components have had no influence on the actual math grades in any of the sub-groups; and Arab girls in single-sex classes scored the highest in internal motivation and in believability of own math abilities and the lowest in stability of math abilities. In addition, within one year the students in the less-prestige religious Jewish school scored as high as those learning in the other Jewish school, considered one of the best in Israel.