Answer:
The expression for the magnitude of the accelerations is

Step-by-step explanation:
According the Newton´s second law:

Clearing T for second equation:
T = ma + mg
Replacing in the first equation:
Mg - ma - mg = Ma
Ma + ma = Mg - mg
a(M + m) = g(M - m)
