Two masses are connected by a string which passes over a pulley accelerating upward at a rate as shown. If $a_1$ and $a_2$ are the accelerations of bodies 1 and 2 respectively, find the value of $A$ (in terms of $a_1$ and $a_2$).
For the body 1:- $$T-m_1g-m_1A=m_1a_1$$
For the body 2:- $$T-m_2g-m_2A=-m_2a_2$$
Subtracting the two equations we get:- $$m_1g-m_2g+m_1A-m_2A=m_1a_1+m_2a_2$$
I am not sure about this but assuming the numbers on the blocks are in fact the masses we can substitute $m_1=1kg$ and $m_2=2kg$. But even then there is still the $g$ variable I am not able to eliminate and by adding the initial equations a new tension $T$ variable shows up, what should I do?