I wanted to prove the work energy theorem in three dimensions starting from Newton's second law of motion. I am having some trouble understanding differential swapping and deriving the kinetic energy formula in three dimensions. Assuming $F_c$ is the sum of all conservative force and $F_{nc}$ is a non-conservative force, for one dimension I have the following.
$$F_{c}+F_{nc}=ma$$
$$\int_{x_{1}}^{x_{2}}F_{c}\ dx\ +\ \int_{x_{1}}^{x_{2}}F_{nc}\ dx\ =m\int_{x_{1}}^{x_{2}}adx$$
$$adx=\frac{dv}{dt}dx=\frac{dx}{dt}dv=vdv \; \label{*} \tag{*}$$
$$m\int_{v\left(x_{1}\right)}^{v\left(x_{2}\right)}vdv\ =\ \frac{1}{2}mv\left(x_{2}\right)^{2}-\frac{1}{2}mv\left(x_{1}\right)^{2}=KE_f-KE_i$$ Using $\frac{dU}{dx}=-F_{c}$, and assuming integrating $F_{nc}$ gives a change in energy $ΔW_{nc}$, we have, $$U_{i}-U_{f}\ +\ ΔW_{nc}=KE_{f}-KE_{i}.$$
In the manipulation to obtain equation $\eqref{*}$, why exactly are we allowed to swap the differentials? Is there a rigorous way to show why you're allowed to do that?
Moreover for the 3D case, assuming that an object is moving along a curve $C$, $$\vec{F_c}+\vec{F_{nc}}=m\vec{a},$$ $$\int_C \vec{F_c}\cdot d\vec{r} +\int_C \vec{F_{nc}}\cdot d\vec{r} = m\int_C \vec{a}\cdot d\vec{r},$$ and further using, $$\nabla U=-\vec{F_c}$$ $$\int_C \vec{F_c}\cdot d\vec{r}=-\int_C\nabla U\cdot d\vec{r} = U_i-U_f,$$we have $$U_{i}-U_{f}\ +\ ΔW_{nc} = m\int_C (a_x \hat{i}_x + a_y \hat{i}_y + a_z \hat{i}_z) \cdot d\vec{r}.$$
How exactly do we handle the final integral on the right? I’m sort of confused since $a$ is an acceleration field now, and I’m not sure if I can do the differential swap trick from before. Is $\vec{a}$ the time derivative of a velocity field now? Also on a different note, could that integral be evaluated using the fundamental theorem of line integrals?
The final result $KE_f-KE_i$ involves computing a value at the beginning and end of the curve (similar to what FTC of line integrals does). That's why I was asking. Thanks!