I am reading "Classical Mechanics-Third Edition; Herbert Goldstein, Charles P. Poole, John L. Safko" and in the first chapter I came across the work-energy theorem (paraphrased) as follows:
The work done on a particle by a force $F$ from point 1 to point 2 is given by: $$ W_{12} = \int_{1}^{2}F\cdot ds \tag{1.29} $$ Since $F = \dfrac{dp}{dt}$, we can write this as: $$ W_{12} = \int_{1}^{2}\left(\dfrac{dp}{dt}\right).ds $$ Also, since $p = mv$ and $ds = vdt$: $$ W_{12} = \int_{1}^{2}\left(\dfrac{d(mv)}{dt}\right).vdt $$ Now, we take the case of unchanging mass and we get $$ \begin{align} W_{12} &= m\int_{1}^{2}\left(\dfrac{dv}{dt}\right).vdt\\ &= \dfrac{m}{2}\int_{1}^{2}\dfrac{d}{dt}\left(v^2\right)dt\\ &= m\int_{1}^{2}\left(\dfrac{d}{dt}v.v\right)dt\\ &= m\int_{1}^{2}\left(v_2^2 -v_1^2\right) \end{align} $$ Since $\dfrac{m}{2}v^2$ is the kinetic energy (denoted by $T$): $$ W_{12} = T_2 - T_1 $$ I am not comfortable with how that factor of $\dfrac{1}{2}$ magically appears when going from $m\int_{1}^{2}\left(\dfrac{dv}{dt}\right).vdt$ to $\dfrac{m}{2}\int_{1}^{2}\dfrac{d}{dt}\left(v^2\right)dt$. Could someone help with this? I have a feeling that it has something to do with vector calculus but I don't know how.
As said in answers: $$ \begin{align} \int_{1}^{2}\left(\dfrac{mdv}{dt}.v\right)dt &= m\int_{1}^{2}\left(\dfrac{dv.v}{dt}\right)dt\\ &= m\int_{1}^{2}\left(\dfrac{v.dv}{dt}\right)dt\\ &= m\int_{1}^{2}\left(\dfrac{\dfrac{1}{2}dv^2}{dt}\right)dt\\ &= \dfrac{1}{2}m\int_{1}^{2}\left(\dfrac{dv^2}{dt}\right)dt\\ &= \dfrac{1}{2}mv^2\\ \end{align} $$
Also, the entire derivation is done under the assumption that $dm=0$. Does this mean that when $dm\neq 0$, we can not compare work done with change in kinetic energy?