Two blocks of masses m1 and m2 interconnected by a spring of stiffness k are placed on a horizontal surface. If a constant horizontal force F acts on the block m1 it slides through a distance x whereas m2 remains stationary. If the coefficient of friction between all contacting surfaces is μ, find the speed of the block m1 as a function of x.