Swapping differentials (rigorously) Lets say we have work integral
$$\int Fdx=m\int\frac{dv}{dt}dx=m\int dv\frac{dx}{dt}$$
These things are done in physics all the time, but $\frac{dv}{dt}$ is not simply a ratio of two unrelated quantities. They are deeply connected in the limit and does not really exist independently. I'm not sure if this swapping is rigorously allowed.
I guess a way to formalize it is to parametrize function $v$ as $v(x(t))$, then 
$$\frac{dv}{dt}=\frac{dv}{dx}\frac{dx}{dt}$$
$$\int\frac{dv}{dt}dx=\int\frac{dv}{dx}\frac{dx}{dt}dx = \int\frac{dx}{dt}\frac{dv}{dx}dx$$
and somehow $dx$ suppose to magically cancel.
I think I am almost right, but I don't understand how $dx$ cancels each other. What is mathematically rigorous way of swapping $dt$ in cases like this?
 A: To understand the swapping you need to know two things. Firstly, we need to know the chain rule
$$\frac{\textrm{d}}{\textrm{d}x}[f(g(x))] = \frac{\textrm{d}f}{\textrm{d}g}\frac{\textrm{d}g}{\textrm{d}x}$$
and secondly we need to know the fundamental theorem of calculus
$$\int\frac{\textrm{d}}{\textrm{d}x}[f(x)]\ \textrm{d}x = f(x) + C.$$
We make the following claim:
Theorem 
If $g$ is differentiable and $f$ is continuous over the range of $g$ then
$$\int f(g)\frac{\textrm{d}g}{\textrm{d}x}\ \textrm{d}x = \int f(g)\ \textrm{d}g.$$
Proof 
Let $F$ be an antiderivative of $f$, i.e. $\frac{\textrm{d}}{\textrm{d}x}[F(x)] = F'(x) = f(x).$ Then (by chain rule) we have
$$\frac{\textrm{d}}{\textrm{d}x}[F(g(x))] = \frac{\textrm{dF}}{\textrm{d}g}\frac{\textrm{d}g}{\textrm{d}x} = f(g)\frac{\textrm{d}g}{\textrm{d}x}.$$
Substitute into our integral and apply the fundamental theorem of calculus.
\begin{align} \int f(g)\frac{\textrm{d}g}{\textrm{d}x}\ \textrm{d}x &= \int \frac{\textrm{d}}{\textrm{d}x}[F(g(x))] \textrm{d}x \\
&= F(g(x)) + C\\&= F(g) +C \\ &= \int \frac{\textrm{d}}{\textrm{d}g}[F(g)]\textrm{d}g \\ &=\int f(g) \textrm{d}g \end{align}
