# Problem understanding a kinematic derivation

An object is moving with a changing acceleration that is given as a function of position as $$a(x)=-k\sqrt{v}$$ where $k$ is a positive constant. Initial velocity is $v_0$. It is found that the object is going to come to rest at $$t_{stop}=\frac{2\sqrt{v_0}}{k}$$ The problem is in finding the distance traveled in that time. By integrating acceleration I obtain $$v=\frac{k^2t^2}{k}$$ then I solve $$\int_0^{t_{stop}}v(t)dt=\frac{k^2t_{stop}^3}{12}$$ and then I eliminate $t_{stop}$ to obtain $$d=\frac{2v_0^{3/2}}{3k}$$ and this is correct by the book. However when I integrated acceleration to obtain the function of velocity, shouldn't I add a constant ($v_0$) to obtain $$v=v_0+\frac{k^2t^2}{k}$$ However, the object comes to rest eventually but as we see if $v_0>0$ then $v(t)$ will never equal zero. Should I add the initial velocity term? If the object comes to rest does that mean that $v_0<0$? Should there be an additional term accounting for the initial velocity in the equation for the distance traveled?

However, the object comes to rest eventually but as we see if $v_0>0$ then $v(t)$ will never equal zero. Should I add the initial velocity term?
Yes, you need to take initial velocity into account when determining $v(t)$, after all you altready defined that $v_0\neq 0$. So:
$$a=-k\sqrt{v}$$ So: $$\frac{dv}{dt}=-k\sqrt{v}$$ $$\int_{v_0}^{v(t)}v^{-1/2}dv=-k\int_0^tdt$$ $$\Big[2v^{1/2}\Big]_{v_0}^{v(t)}=-kt$$ $$2\big(\sqrt{v(t)}-\sqrt{v_0}\big)=-kt$$ $$v(t)=\Bigg(\sqrt{v_0}-\frac{kt}{2}\Bigg)^2$$ Stop time: $$v(t)=0\implies \sqrt{v_0}-\frac{kt}{2}=0$$ $$t_{stop}=\frac{2\sqrt{v_0}}{k}$$ Note also that $a$ is not a function of $x$: $a$ is the rate of change (in time) of velocity $v$.