well how did you do the first part? it looks right to me. you did:
[tex]\sum{F} = ma[/tex]
always always ALWAYS start with this over and over again (or at least try to strat with this). The right hand side will have only ma or 0 that's all it will ever have ( and zero is a particular case of ma--when it is not accelarating, that is, not moving, or constant velocity) The left hand side just sums your forces. So after picking your postitive and negnative on your x and y-axis (always do this too) and drew your free body diagram (I hop you did this) you must of did:
[tex]T + T = m_2a_2[/tex]
And then you solved for T
Now for the next part do the same thing
1) Draw FBD
2) [tex]\sum{F} = ma[/tex]
3) [tex]T - m_1g = m_1a_1[/tex]
And then solve for [tex]a_1[/tex] in terms of everything else they gave you