Factors influencing mathematics academic achievement are constantly changing and have direct and indirect effects on mathematics achievement, so longitudinal studies that can predict and analyze their growth are needed. This study uses longitudinal data on students from 2011 (5th grade of elementary school) to 2015 (2nd grade of middle school) of the Seoul Education Longitudinal Study, and divides them into groups with similar longitudinal changes in mathematics academic achievement. The direct and indirect effects of learning attitudes and achievement goals were examined. As a result of the study, it was found that learning effort and learning attitude had a direct effect on mathematics achievement in 1 group (2277 students, 67.7%), and learning attitude had a direct effect on mathematics achievement in 3 groups (958 students, 28.5%). And it was found that learning effort h ad an indirect effect. In addition, it was found that both learning attitudes, learning efforts, and achievement goals had no effect on the academic achievement of mathematics in the second group (127 students, 3.8%).