if ${dy\over dx}$ is not ratio then why can we use commutative law of multiplication on it? In maths class i have been taught not to treat ${dy\over dx}$ as a ratio but in physics why do we treat it like one.

$$dw = f ds \implies dw = m \times {dv\over \color{red}{dt}} \times ds \implies dw = m\times dv\times{ds \over \color{red}{dt}}$$
$$\text{w is work done, f is force, v is velocity, s is displacement, t is time and m is mass}$$

If ${dy\over dx}$ is not a ratio then how did it change its numerator ? I think it will be clear if somebody can rewrite the above equation in Lagrange's notation. I hope i did not trouble anyone by asking this question. Thanks.
 A: This is one of the reasons that Leibniz notation is often described as 'powerful'.
Using the Calculus of Limits,
$\frac{dv}{dt}ds
=\lim_{\delta t \to 0}{\frac{v(t+\delta t) - v(t)}{\delta t}} . [s(t+\delta t) - s(t)] = \lim_{\delta t \to 0}v(t+\delta t) - v(t) . \frac{s(t+\delta t) - s(t)}{\delta t}=dv\frac{ds}{dt}$
A: I would regard $dw = f \, ds$ as an abuse of notation for either $f=\dfrac{dw}{ds}$ or $\displaystyle \int dw = \int f \, ds$.
That being said, in analysis you can show the chain rule: $\dfrac{dz}{dx}= \dfrac{dz}{dy}\dfrac{dy}{dx}$ and the inverse function rule $\dfrac{dy}{dx} = \dfrac{1}{\frac{dx}{dy}}$ under specified conditions, and these will lead to what you call commutative multiplication
A: The differentials $dy$ and $dx$ are new variables which are related to each other by $dy = f^{\prime}(x) \; dx$, which is the same as $dy = \frac{dy}{dx} \; dx$.  One way to think of the differentials is to pick a point on the curve $y=f(x)$ and make that point the origin of a $dx-dy$ coordinate system, where the $dx$-axis is parallel to the $x$-axis and m.m. $dy$ and $y$. (It's sort of a traveling co-ordinate systems that moves along with your choice of $x$.) The tangent line to the curve at that point has equation $dy = f^{\prime}(x) \; dx$ in the $dx-dy$-plane.  Because of the equation of this line, we can replace $dy$ by $\frac{dy}{dx} \; dx$.  In your example, we take $$m \times \frac{dv}{dt} \times ds$$ and multiply through by $dt$ to get $$m \times \frac{dv}{dt}\times dt \times ds.$$  Then we replace the  $\frac{dv}{dt}\times dt$ with $dv$ to get $$d \times dv \times ds.$$  Now we have to pay for multiplying by $dt$, so we replace $ds$ bye $\frac{ds}{dt} \times dt$ to get $$m\times dv \times $\frac{ds}{dt} \times dt.$$  Then we divide by $dt$ to make up for multiplying by $dt$ earlier and get $$m\times dv \times \frac{ds}{dt}.$$ 
All these "replacements" look exactly like cancelling (or un-cancelling) a $dt$.
