Assume that, mass m1 is greater than mass m2, so the heavier mass m1 is accelerating downward and the lighter mass m2 is accelerating upwards. For mass m1 the equation will be m1g−T=m1a For mass m2 the equation will be T−m2g=m2a Adding those equations we get a=‌