To start with, we should work out all of the quantities we need:
Mass of Trolley A: MA= 5kg
Mass of Trolley B: B weighs 10kg more than A
--> Therefore MB= 10 + 5 = 15kg
Mass of Both Trolleys together: MAB = 15 + 5 = 20kg
Initial Velocity of A: VA= 15 m/s
Initial Velocity of B: VB= 0 m/s
By the conservation of momentum, we know that the total momentum of a closed system is unchanged for any process. Thus the initial and final momenta of the two trollies combined are the same, ie:
PA + PB = PAB where P is momentum
We know that momentum P = mv
Therefore:
MAVA + MBVB = MABVAB
From above, we know all of these quantities except for VAB which is the quantity we need to find for the answer. Thus we can substitute in all of the values and find VAB:
(5x15) + (15x0) = (20xVAB)
75 = 20VAB
VAB = 75/20 = 3.75 m/s