The end of a pile of loose-link chain of mass $\rho$ per unit length is being pulled horizontally along the surface by a constant force $P .$ If the coefficient of kinetic friction between the chain and the surface is $\mu_{k},$ determine the acceleration $a$ of the chain in terms of $x$ and $\dot{x}$.