Calculate the acceleration of the masses and the tension in the string for each system

Given data:
Mass m1=9 kg
Mass m2=13 kg
To find:
Acceleration of the masses and the tension in the string for each system.
Solution:
By applying the newton's second law,
For mass m1, The equation can be written as,
[tex]T-m_1g=ma---(1)_{}_{}[/tex]For the mass m2, the equation is
[tex]m_2g-T=m_2a---(2)[/tex]By adding these two equation we can get a formula to find acceleration,
[tex]\begin{gathered} (m_2-m_1)g=(m_1+m_2)a \\ a=\frac{(m_2-m_1)g}{(m_1+m_2)} \end{gathered}[/tex]Here, by substituting the known values we can get
[tex]\begin{gathered} a=\frac{(13-9)9.8}{(9+13)} \\ a=\frac{39.2}{22} \\ a=1.78m/s^2 \end{gathered}[/tex]
Thus the acceleration is 1.78m/s^2.
Now, to calculate the tension,
[tex]\begin{gathered} m_2g-T=m_2\frac{(m_2-m_1)g}{(_{}m_1+m_2)} \\ T=\frac{2m_1m_2g}{(m_1+m_2)} \\ T=\frac{2\ast9\ast13\ast9.8}{9+13} \\ T=\frac{2293.2}{22} \\ T=104.24\text{ N} \end{gathered}[/tex]
Thus, the tension in s string is 104.24 N