Left most figure shows the free body diagram of block-A when 12 N force is applied to block-A
and block-A is about to slip on block-B.
hence we have , μN = ( μ 4 g ) = 12 or μ = 12/ (4 × 9.8 ) = 0.306
where μ is friction coefficient, N is normal force equals 4g , where g is acceleration due to gravity.
Middle figure shows the forces acting on block-A , when block-B is pulled with force Fm .
Now friction force μN pulls block-A. Hence acceleration of block a = (μN) / 4 = (0.306×4 ×9.8)/4 = 3 m/s2
if both the blocks move together, acceleartion of system is a = 3 m/s2
Right most figure shows the free body diagram of block-B , when system moves with a = 3 m/s2
friction force shown as μN is the reaction force on block-B due to friction acting on block-A
Hence, if Newton's law is applied to block-B, we have
Fm - μN = mB × a or Fm = mB × a + μN = ( 5 × 3 + 0.306 × 4 × 9.8 ) = 27N