Saw this in a physics lecture. This all assumes we have some function, $y=f(x)$.
First he defined
$$ds = \sqrt{dx^2+dy^2},$$
where the professor drew a picture and seemed to be using dx and dy to mean a very small change in x (or y). I'm not sure what this really means. What does it mean to square a differential, or to have it under the square root sign? But alright, for now I'll say it's an abuse of notation, and just consider them tiny distances.
He then says you can factor out a dx from under the square-root sign as follows:
$$ds = dx \sqrt{1+\left( \frac{dy}{dx} \right)^2}.$$
Ok, assuming we're interpreting dx and dy as tiny lengths, ok.
Now he says interpret the dy/dx as taking the derivative of y with respect to x. What?!? How can what was once considered a length all of a sudden become an operator? If dx and dy are not just tiny distances, how can you do algebra with differentials? What sort of black magic is this? Can someone please explain what's going on? Thanks.
Edit: Maybe a better, and more general question is this. If we replace all the d's with $\Delta$'s and the equal sign with an approximation sign, the algebra becomes correct. Why and when, if ever, is it okay to "take the limit" and replace a $\frac{\Delta y}{\Delta x}$ with a derivative, and the approximation sign with an equal sign? Because I feel like physicists do this a lot.
What he did is correct, though the reasons for doing so seem to be glossed over. I'll give you a rigorus version of what he did.
Let $\Delta x > 0$, represent the length of some horizontal line segment, and for now let $y = f(x)$, where $f$ is some function. (If $y$ is not a function, simply break it up into several pieces, where each piece is a function.) Then define $$\Delta y = f(x + \Delta x) - f(x)$$ Now, $\Delta x$ and $\Delta y$ are the lengths of legs of a right triangle, so we should probably talk about the hypotenuse, as well, whose length I will denote by $\Delta s$. Now, by the Pythagorean Theorem, $$(\Delta s)^2 = (\Delta x)^2 + (\Delta y)^2 = (\Delta x)^2\left[1 + \left(\frac{\Delta y}{\Delta x}\right)^2\right]$$ (where I pulled out $(\Delta x)^2$ from both terms on the RHS). Substituting our two expression from above, $$(\Delta s)^2 = (\Delta x)^2\left[1 + \left(\frac{f(x + \Delta x) - f(x)}{\Delta x}\right)^2\right]$$ $$\implies \left(\frac{\Delta s}{\Delta x}\right)^2 = 1 + \left(\frac{f(x + \Delta x) - f(x)}{\Delta x}\right)^2$$
Now, take limits of both sides as $\Delta x \rightarrow 0$: $$\lim\limits_{\Delta x \rightarrow 0}\left(\frac{\Delta s}{\Delta x}\right)^2 = \lim\limits_{\Delta x \rightarrow 0}\left[1 + \left(\frac{f(x + \Delta x) - f(x)}{\Delta x}\right)^2\right]$$ $$\implies \left(\lim\limits_{\Delta x \rightarrow 0}\frac{\Delta s}{\Delta x}\right)^2 = 1 + \left(\lim\limits_{\Delta x \rightarrow 0}\frac{f(x + \Delta x) - f(x)}{\Delta x}\right)^2$$ $$\implies \left(\frac{ds}{dx}\right)^2 = 1 + \left[f'(x)\right]^2 = 1 + \left(\frac{dy}{dx}\right)^2$$ $$\implies \left|\frac{ds}{dx}\right| = \sqrt{1 + \left(\frac{dy}{dx}\right)^2}$$ If you assume $s$ increases as $x$ increases, i.e. the length $s$ of your path increases as you move from left to right, we can drop the absolute values: $$\frac{ds}{dx} = \sqrt{1 + \left(\frac{dy}{dx}\right)^2}$$ or, in differential form, $$ds = dx\sqrt{1 + \left(\frac{dy}{dx}\right)^2}$$