If two particles are in motion on a fixed wedge then we have to resolve for each particle perpendicular to the plane and apply F=ma parallel to the plane. We can use T is the same throughout the string, and the acceleration of both particles is the same to form simultaneous equations and solve them to find the acceleration and tension.
If we draw all the forces acting on both particles above we obtain the diagram.
Applyingparallel to slope for A: (1)
Perpendicular to slope for B: (2)
Parallel to slope for B: (3)
Sub (2) into (3)
(1) + (4) gives
Then from (1)