**Question-**

A block of mass $m$ is kept on a rough horizontal surface (coefficient of friction - $\mu $) and is connected to the wall by a spring of spring constant $K$. A force $F$ is applied to it in the direction of the wall. Find the $time{\kern 1pt} taken$ to compress it by $x$ units.

**My Attempt-**

When the spring has been compressed by $x$ units, the **instantaneous velocity** $v$ of the object can be found out through Law of Conservation of Energy, $$Fx - \mu mgx = {\textstyle{1 \over 2}}K{x^2} + {\textstyle{1 \over 2}}m{v^2}$$ $$v(x) = \sqrt {{{2Fx - 2\mu mgx - K{x^2}} \over m}} $$Since $v(t) = {{dx} \over {dt}}$, so $dx = v(t)dt$.

**I am not able to integrate this equation as my expression for $v$ is a function of $x$.
How do we proceed from here?**