# How do physicists know when it is appropriate to use $\mathrm dx$ as if it is a number? [duplicate]

I'm trying to teach myself calculus of variations when I came across a worked example about the shortest distance between two points in a plane. This is a question about the mathematics but I don't think it belongs in Mathematics stack exchange because it's about techniques utilized by physicists.

The worked example starts off by defining a distance function like this:

$$\mathrm ds = \sqrt{\mathrm dx^2 +\mathrm dy^2}$$

So here $$\mathrm ds, \mathrm dx,$$ and $$\mathrm dy$$ are being treated as if they are real (as in actual) numbers that have some real value when they are, in the best case, infinitesimals. The way I understand them is that they either define an operation on a function, such as $$\frac{d}{\mathrm dx}$$, or the derivative of a function that's been acted on by the differential operator, eg. $$\frac{\mathrm dy}{\mathrm dx}$$. They're just notation for operations.

$$\frac{\mathrm dy}{\mathrm dx}$$ is not a ratio of two numbers. They're not numbers as far as I can understand, they represent operations.

The worked example then pulls out a $$\mathrm dx$$ from under the square root, as if it is a number, to get this

$$\mathrm ds = \sqrt{1 +\left(\frac{\mathrm dy}{\mathrm dx}\right)^2} \mathrm dx$$

Then it does this

$$\int \mathrm ds = \int \sqrt{1 +\left(\frac{\mathrm dy}{\mathrm dx}\right)^2} \mathrm dx$$

it's gone back to treating $$\mathrm dx$$ and $$\frac{\mathrm dy}{\mathrm dx}$$ as operators or functions resulting from operations respectively.

My question is, how do you justify when to switch between treating it as a number and an operation? I find this very strange but I see it often in physics literature. Are there circumstances where this doesn't work? Please direct me to any source where I can learn more about this.

• – Qmechanic Dec 27 '19 at 17:09
• Does this answer your question? How to treat differentials and infinitesimals? – BioPhysicist Dec 27 '19 at 17:12
• @Qmechanic Ah, fell into my own pet peeve :) – BioPhysicist Dec 27 '19 at 17:12
• When change in any dependent variable becomes linear with respect to the change in independent variable then the slope becomes constant/number at that interval. – Alex Dec 27 '19 at 17:18

You are a victim of a quite frequent way of teaching calculus which continues to show embarrassment with the differentials, even if nowadays we have all the conceptual tools to deal with them in a safe way.

Forget about operators (which are not the natural way of looking at things in the present context) and infinitesimals (which mean too many things, some of them obsolete and inconsistent).

Let me try to show a consistent way of thinking and using differentials.

I assume that we have the definition of derivative of a real function of one real variable. Let's indicate the derivative of a function $$f$$ in a point $$x_0$$ as $$f^{\prime}(x_0)$$. If the function is smooth enough (for our purposes it is sufficient that its first derivative is a continuous function) the first derivative at $$x_0$$ tells us how the function behaves locally in a neighbor of $$x_0$$: $$f(x) = f(x_0) + f^{\prime}(x_0) (x-x_0) + O((x-x_0)^2)$$ from which we can say that the best linear approximation to the variation of $$f$$ around $$x_0$$ is represented by $$f^{\prime}(x_0) (x-x_0)$$.

We call such a best linear approximation of the variation of $$f$$ around $$x_0$$ the differential of $$f$$ at $$x_0$$ and we denote it by $$df_{x_0}$$. It is clear from its explicit expression that it is a (in general non-linear) function of $$x_0$$ and a (linear) function of $$x$$. It is also clear that such linear function of $$x$$ is defined for any $$x$$, but only in the neighborhood of $$x_0$$ we can write $$\Delta f = f(x)-f(x_0) \simeq df_{x_0}(x) = f^{\prime}(x_0) (x-x_0).$$

At this point we can observe that our definitions and notations allow to write unambiguously $$\Delta x = x-x_0 = dx_{x_0} = 1 \cdot (x-x_0)$$ and therefore we are enabled to write $$\frac{\Delta f}{\Delta x} \simeq \frac{df_{x_0}}{d x_{x_0}} = f^{\prime}(x_0),$$ where we know that the symbol $$\simeq$$ here means a part corrections which vanish when $$(x-x_0)\rightarrow 0$$ at least linearly.

You see that this way of dealing with differentials is fully consistent, differentials are real valued functions, and no strange infinitesimal quantity is around.

Generalization to differentials of more than one variable or to vector valued functions is of course possible and it is a trivial generalization of the previous treatment. For example, the length of line element of a curve, $$ds$$, you wrote in you question can be written as $$ds = \sqrt{dx^2+dy^2}=\sqrt{x^{\prime 2}+y^{\prime 2}} d\tau$$ if $$\left(x(\tau),y(\tau)\right)$$ is a parametrization of the curve. Each quantity appearing with a $$d$$ here is a differential, and at the and of the day, a real number.

I agree that, even if everything above is nothing but math, it is the community of physicists which seems to be more uneasy with the manipulations of differentials.

• I like it that there seems to be a consistent way sbout differentials. Could you explain the chain rule with this? (Its clear that the physicist way doesnt really capture the correct proof) – lalala Dec 27 '19 at 18:07
• @lalala Sure, it is possible. If you have $z(x)=f(g(x))$ you can get the best linear approximation of $\Delta z$ by composing the best linear approximation of $f$ with the best linear approximation of $g$. And you'll get the explanation of the usual chain rule. In any case, there is nothing new with respect to the usual formulas. – GiorgioP Dec 27 '19 at 18:22
• Thats just phrasing out the chain rule. – lalala Dec 27 '19 at 19:05
• @AaronStevens Ooops! just a residual typo. Thank you, I'll fix it. – GiorgioP Dec 28 '19 at 7:15

I would say that the "operations" and "treating differentials as numbers" are really the same thing. You can view $$\frac{\text dy}{\text dx}$$ as performing an "operation" denoted by $$\frac{\text d}{\text dx}$$ on a function $$y(x)$$, or you can think of $$\frac{\text dy}{\text dx}$$ as an actual ratio comparing by how much the function changes ($$\text dy$$) when you change the input by some amount ($$\text dx$$). i.e. the "operation" of applying $$\frac{\text d}{\text dx}$$ to a function $$f$$ means to find that ratio for all values of $$x$$.

So, in your final integral you are essentially adding up all contributions $$\sqrt{1 +\left(\frac{\mathrm dy}{\mathrm dx}\right)^2} \mathrm dx$$ where you can think of $$\frac{\text dy}{\text dx}$$ as a ratio of "numbers" and $$\text dx$$ as a "number".

how do you justify when to switch between treating it as a number and an operation?

Even if these two things can be thought of as the same thing, this really is more of an opinion. Whatever is the easiest for you to think about, go with that. The math itself doesn't really care about how we think about it (as long as our thoughts are still mathematically valid).

Another approach: the operator is “d”, and there’s only one of them. The “d” operator does “take a so-small-as-to-ensure-linearity sample”.

Since there’s only one of these, the d in dx and the d in dt work consistently to give you a valid dx/dt for velocity, dy/dx for slope, etc.

The dx really can be treated as just a number once you’ve specified a particular point for evaluation. You don’t know what that number is, the operator has made an arbitrary choice, but it still has all the properties of a number.

One way I like to think about such derivation is first to approximate the length element as in the picture below: We can easily deduce, that: $$\Delta s\approx\sqrt{\Delta y^2 + \Delta x^2}\\\text{We can simply 'pull out' the x part and obtain:}\\\Delta s\approx\sqrt{1+\Biggl(\frac{\Delta y}{\Delta x}\Biggr)^2}\,\Delta x\\\text{Finally taking the limit, the approximation gets exact:}\\\lim_{\Delta \to 0}\Delta s=ds=\sqrt{1+\Biggl(\frac{d y}{d x}\Biggr)^2}\,dx$$

• This is correct, but I don't think it really answers the question, or if it does it isn't explicitly obvious. – BioPhysicist Dec 27 '19 at 16:53