I asked this in the physics exchange, but was told this is more really of a math issue. In this problem
\begin{eqnarray} T&=&m_1 a \\T - m_2 g &=& -m_2 a \end{eqnarray} From these equations, we can express $a$ and $T$ in terms of the masses $m_1$ and $m_2$ and $g$: \begin{eqnarray} a &=& \frac{m_2}{m_1 + m_2} g \\ T &=& \frac{m_1m_2}{m_1 + m_2} g \end{eqnarray}
I'm completely confused on how they expressed $a$ and $T$. What am I solving for in $T=m_1a$ and $T-m_2g= -m_2a$? I thought I was solving for one to input into the other, but I don't think that's it because I can't put it into each other. I don't understand how they found $a$ and $T$ from the equations $T=m_1a$ and $T-m_2g=-m_2a$. How are those 2 equations being manipulated to find $a$ and $T$?