Previous research has demonstrated that motivation is a key determinant in students’ engagement with mathematics, yet many earlier studies have employed variable-centered approaches, failing to fully capture the interdependent aspects of motivational factors. This investigation involved 933 junior middle school students (52.5% girls; $M$ age = 12.97, SD = 0.71) across 27 mathematics classrooms in China, aiming to uncover the patterns of student domain- and homework-specific motivational beliefs and their correlations with various forms of social support. Utilizing latent profile analysis, the study discerned five distinct profiles in mathematics, drawing on expectancy, value and cost beliefs from situated expectancy-value theory: maladaptive, high-cost, value-deprived, moderately motivated, and adaptive. Analogously, five profiles in homework settings were identified: maladaptive, cost-focused, high-attainment and utility value moderate-costs, moderately motivated, and adaptive. Moreover, teacher support is particularly influential in shaping students’ expectancy-value profiles in mathematics, particularly in assigning students into the adaptive profile and steering away from the “value-deprived” profile. Whereas, parental support is effective in shaping students’ expectancy-value profiles in mathematics homework. In contrast, peer support exerts only a modest pull, showing the weakest links with those profile memberships in both settings.