I am currently reading Physics for Scientists and Engineers (Ninth Edition) by Serway and Jewett and in Chapter 7.5, a derivation of the work-kinetic energy theorem was shown.
To give context, consider a system consisting of an object of mass $m$ moving through a displacement directed to the right due to a net force $\sum F$ , also directed to the right.
The derivation process was then, $$\begin{aligned} W_{\text{ext}} &= \int_{x_i}^{x_f} \sum F \ dx \\ &= \int_{x_i}^{x_f} ma \ dx \\ &= \int_{x_i}^{x_f} m \frac{dv}{dt} \ dx \\ &= \int_{x_i}^{x_f} m \frac{dv}{dx} \frac{dx}{dt} \ dx \\ &= \int_{v_i}^{v_f} mv \ dv \end{aligned}$$
Unfortunately, I'm having trouble understanding how the author arrived at the final step from the previous one.
I have tried equating $v = dx/dt$ and using substitution rule with the same variable $v = x$ and $dv = dx$ to arrive at
$$W_{\text{ext}}= \int_{v_i}^{v_f} mv \frac{dv}{dv} \ dv$$
and then cancelling the $dv$'s as if they were a fraction to get the same result as the book but I think I'm terribly mistaken.
Can someone perhaps shed insight on how to proceed with this problem?