Using a tilted coordinate system will make things easier.
We need to come up with an equation for each block with a and T and then solve them simulaneously for one of the variables. Knowing that the sum of forces in the y-direction is zero for block number one will get us moving toward defining the force of friction, the only unknown of the forces in the x-direction.
Work for
:
Now we have to do the same thing for mass number two.
Again we start with the realization that there is no movement in the y-direction, so we can find the normal force which will give us the frictional force.
Work for
:
Add the two equations just worked out for the blocks which will eliminate T and then solve for a:
Now knowing ''a'' we can return again and use that value and plug it in and solve for ''T''