As there is no sliding between the blocks , the friction will be static. Assuming the frictional forces on `m_(1)` as `f(larr)` and `m_(2)` as `f(rarr )` we have drawn the `FBD` without normal reactions and weight .

Referring to `FBD` as shown in fig we have the following equation of motion :
For `m_(1): F_(1) -f = m_(1)a_(1)` ...(i)
For `m_(2) : F_(2) +f =m_(2)a_(2)` ...(ii)
Since the friction is static `a_(1) = a_(2)`
Substituting Eq (i) `a_(1)`from Eq `a_(1)`(ii) in (iii) we have
`(F_(1) - f)/(m_(1)) = (F_(2) - f)/(m_(2))`
This gives `f = (m_(2)F_(1) - m_(1)F_(2))/(m_(1) + m_(2)`