This question is very similar to this one here.
A block of mass $m_1$ is placed on another block of mass $m_2$ lying on a smooth horizontal surface.
The coefficient of friction (static and kinetic) between $m_1$ and $m_2$ is $\mu$.Find the acceleration of the blocks if the force applied to $m_1$ is $5N$, given that $m_1 = 2kg$ and $m_2 = 4kg$ and $\mu=0.2$.
I can prove the result in the link, and obtain the critical force as $6N$, so for $5N$, they will have same acceleration, which will be equal to $\frac{5}{6}$.
But when I take the the general case, draw free body diagrams, I get these equation -
$$ m_1 a_1 = F - \mu m_1 g \\ m_2 a_2 = \mu m_1 g $$
This gives the answer as $a_1 = \frac{1}{2}$ and $a_2 = 1$
The only place where I think I could have made a mistake would be in case of force of friction. I am taking the maximum value of friction ($4N$), but since the force applied is greater, I presume this can happen.
Can anyone tell me where I go wrong?