Since, the applied force is proportional to the time and the frictional force also exists, the motion does not start just after applying the force. The body starts its motion when F equals the limiting friction.
Let the motion start after time t0, then
F=at0=kmg or, t0=kmga
So, for t≤t0, the body remains at rest and for t>t0 obviously
mdvdt=a(t−t0) or, mdv=a(t−t0)dt
Integrating, and noting v=0 at t=t0, we have for t>t0
∫v0mdv=a∫tt0(t−t0)dt or v=a2m(t−t0)2
Thus, s=∫vdt=a2m∫tt0(t−t0)2dt=a6m(t−t0)3