A recent question on Math SE included finding the antiderivative of
$$\int y'y''\,dx,$$
where $y'=\frac{dy(x)}{dx},y''=\frac{d^2y(x)}{dx^2}$ as $y=y(x)$. One approach to solve this problem is by direct substitution. Let
$$u=\frac{dy}{dx}=y' \implies du=y''\,dx,$$
then the left hand side becomes
$$\int y'y''\,dx=\int u\,du=\frac{1}{2}u^2+C=\frac{1}{2}\left(y'\right)^2+C.$$
A second approach involves writing out the integral completely and then canceling the $dx$
$$\int \frac{dy}{dx} \frac{d^2y}{dx^2}\,dx=\int \frac{d^2y}{dx^2}\,dy=\int y''\,dy=\int\frac{dy'}{dx}\,dy=\int\frac{dy'}{dx}y'\,dx=\int y'\,dy'=\frac{1}{2}\left(y'\right)^2+C.$$
In this approach, it is crucial to make the following observation:
$$dy=\frac{dy}{\require{cancel} \cancel{dx}}\,\require{cancel} \cancel{dx}=y'\,dx \implies \frac{dy'}{dx}\,dy=\frac{dy'}{\require{cancel} \cancel{dx}}y'\,\require{cancel} \cancel{dx}=y'\,dy'.$$
Through reviewing other questions on Math SE and Math Overflow, it appears that you are always able to "divide out" the $dx/dx$. This is because $dx$ is an infinitesimally small positive change in $x$. Therefore, as $dx\neq 0$ you can divide out $dx$ with itself to conclude
$$\frac{dx}{dx}=1$$
at any point in integration (assuming that what you are integrating is well-defined). This is further represented by the fact that the Riemann integral can be expressed as the limit of Riemann sums
$$\int_a^b f(x)\,dx=\lim_{n\to\infty}\sum_{i=1}^nf(x_i)\Delta x,$$
where $\Delta x$ means an infinitesimally small step on the x-axis to correspond with the infinitesimally small change in $x$ associated with the Riemann integral.
One can justify canceling the $dx$ terms by the answer shown inside this Math Overflow question. However, they would need to know differential forms which is a topic that I am unfamiliar with. A different answer on Math SE provides a more familiar explanation in which one can write the first fundamental theorem of calculus in Leibnitz notation as:
$$\int _a^b \frac{df}{dx}\,dx = f(b) – f(a).$$
Inside this answer, it is shown that you can "cancel" the two $dx$ terms even though you are not literally cancelling $dx/dx$. The fact that these two terms cancel is directly due to notational convenience. I'm curious if this sort of notational convenience will fail. I think that one could write
$$\int \frac{dy}{dx}\,dx=\int \frac{dy}{\require{cancel} \cancel{dx}}\,\require{cancel} \cancel{dx}=\int dy,$$
$$\int \frac{dy}{dx}\frac{dy}{dx}\,dx=\int \frac{dy}{\require{cancel} \cancel{dx}}\frac{dy}{dx}\,\require{cancel} \cancel{dx}=\int \frac{dy}{dx}\,dy,$$
$$\int \frac{dy^n}{dx^n}\frac{dy}{dx}\,dx=\int \frac{dy^n}{dx^n}\frac{dy}{\require{cancel} \cancel{dx}}\,\require{cancel} \cancel{dx}=\int \frac{dy^n}{dx^n} \,dy,$$
$$\int \frac{dy}{dx}dy\,dx=\int \frac{dy}{\require{cancel} \cancel{dx}}dy\,\require{cancel} \cancel{dx}=\int (dy)^2.$$
Is there a scenario in which you cannot cancel $\frac{dx}{dx}$ inside an integral as if it were a fraction equal to $1$? Can you also cancel these two terms through a substitution made inside the integral?
Best Answer
It is a common misconception that $dx$ is an "infinitesimal". $dx$ is a differential, i.e. an arbitrary, nonzero quantity representing a variation.
When there is a dependent variable, say $y=f(x)$, the differential of $y$ is related to that of $x$ by
$$dy=f'(x)\,dx.$$
By this definition, $dy$ is "the linear part of the variation of $y$ for a given variation of $x$", as explained by Taylors' development.
This is to be contrasted with
$$\Delta y=f(x+\Delta x)-f(x)=f'(x)\Delta x+R(x,\Delta x)$$ (where $R$ is a remainder term) which is the ordinary variation.
Hence, $dx,dy$ can really be handled like numbers, and
$$\frac{dy}{dx}=f'(x)=\lim_{\Delta x\to 0}\frac{\Delta y}{\Delta x}.$$
Example:
For the function $y=x^2$,
$$\Delta y=(x+\Delta x)^2-x^2=2x\Delta x+\Delta^2 x$$ while the linear part is
$$dy=2x\,dx.$$
Note that $dx$ and $\Delta x$ both represent arbitrary variations, but I kept both for the symmetry of the formulas.