A 5.00-kg object placed on a frictionless, horizontal table is connected to a cable that passes over a pulley and then is fastened to a hanging 9.00-kg object, as in Figure. Find the acceleration of the two objects and the tension in the string.
The given answer looks like:
$$ mg-T=9a \\ 9 \times 9.8 - T = 9a \\ 22.2 - T = 9a \text{ --- (1)} $$
Where did 9a come from?
Then it continues
$$ T=5a \text{ --- (2)} \\ \text{sub (2) into (1)} \\ 22.2 - 5a = 9a \\ 14a = 88.2 \\ a = 6.3 \\ T = 5a = 5 \times 6.3 = 31.5N $$