AbstractThis paper aims to give detailed insights of interactional aspects of students’ agency, reasoning, and collaboration, in their attempt to solve a linear function problem together. Four student pairs from a Norwegian upper secondary school suggested and explained ideas, tested it out, and evaluated their solution methods. The student–student interactions were studied by characterizing students’ individual mathematical reasoning, collaborative processes, and exercised agency. In the analysis, two interaction patterns emerged from the roles in how a student engaged or refrained from engaging in the collaborative work. Students’ engagement reveals aspects of how collaborative processes and mathematical reasoning co-exist with their agencies, through two ways of interacting: bi-directional interaction and one-directional interaction. Four student pairs illuminate how different roles in their collaboration are connected to shared agency or individual agency for merging knowledge together in shared understanding. In one-directional interactions, students engaged with different agencies as a primary agent, leading the conversation, making suggestions and explanations sometimes anchored in mathematical properties, or, as a secondary agent, listening and attempting to understand ideas are expressed by a peer. A secondary agent rarely reasoned mathematically. Both students attempted to collaborate, but rarely or never disagreed. The interactional pattern in bi-directional interactions highlights a mutual attempt to collaborate where both students were the driving forces of the problem-solving process. Students acted with similar roles where both were exercising a shared agency, building the final argument together by suggesting, accepting, listening, and negotiating mathematical properties. A critical variable for such a successful interaction was the collaborative process of repairing their shared understanding and reasoning anchored in mathematical properties of linear functions.