# When can we safely treat $dx$ like it were a real number during integration by substitution

$$\def\R{\mathbf{R}}$$ Disclaimer. I am aware that this is similar to this post, but the difference here is I'm asking, when can we safely treat these 'infinitesimal' quantities as though they were real numbers to solve problems quickly.

Learning analysis has taught me to attempt most calculus problems as carefully (i.e. rigorously) as possible. But even "simple" problems become tedious very quickly. Say we want to show that $$\int_{1}^{x}{\frac{dt}{1+t^2}}$$ = $$-\int_{1}^{1/x}{\frac{dt}{1+t^2}}$$ for all $$x\in\R$$, (with the understanding that for $$x=0$$ the right side's limits become $$\int_{1}^{\infty}$$). Doing this non-rigorously would be fairly quick:

Non rigorous proof. Let $$u=1/t$$. Then we have $$du=-dt/t^2=-dt\cdot u^2$$. The limits $$t=1$$ to $$t=x$$ changes to become $$u=1$$ to $$u=1/x$$. Substituting this in the LHS, we get $$\tag{1}\int_{t=1}^{t=x}{\frac{dt}{1+t^2}} = \int_{u=1}^{u=1/x}{\frac{-du/u^2}{1+1/u^2}}=\int_{u=1}^{u=1/x}{\frac{-du}{u^2+1}}=-\int_{t=1}^{t=1/x}{\frac{dt}{1+t^2}}$$ Which proves the claim. $$\square$$

I do not understand what an equation like $$du=-dt/t^2$$ "exactly" means, nor do I think I need to. I believe that it's a very clever notational trick that allows us to "get the answer" without worrying about the technical details. However, I wanted to understand when we can rely on these "18th century" style arguments so we don't have to give formal arguments every time like the one below:

Proof. Define $$f:\R\to\R$$ to be $$f(t):=\frac{1}{1+t^2}$$ and the reciprocal function $$g:\R\setminus\{0\}\to\R$$ via $$g(t)=1/t$$. Then $$f$$ and $$g$$ are continuously differentiable (proofs omitted) and hence integrable. Now we can compose these functions $$f\circ g:\R\setminus\{0\}\to\R$$, (which is still continuous), and now see that $$f=-f\circ g \cdot g'$$ on $$\R\setminus\{0\}$$. Now, for $$x>0$$, we can write and use the integration by substituting rule since $$g$$ has continuous derivative and get $$\tag{2} \int_{1}^{x}{f}=\int_{1}^{x}{-f\circ g\cdot g'}=\int_{g(1)}^{g(x)}{-f}=-\int_{1}^{1/x}{f}.$$ Now for $$x=0$$, we need to show $$\tag{3} \int_{1}^{0}{f} =-\int_{1}^{\infty}{f}\stackrel{\text{def}}= -\lim_{x\to\infty}{\int_{1}^{x}{f}}\stackrel{\text{?}}=-\lim_{\substack{x\to0\\x\in(0,\infty)}}{\int_{1}^{1/x}{f}}$$ To do this we define yet another function $$F:\R\to\R$$ such that $$F(x):= \int_{1}^{x}{f}$$. By the FTC we have $$F$$ is continuous. Reiterating the above work we have done in terms of $$F$$, we can say that $$F= -F\circ g$$ for $$x>0$$. Hence we have $$\tag{4}\int_{1}^{0}{f}=F(0)=\lim_{\substack{x\to0\\x\in\R}}{F(x)} = \lim_{\substack{x\to0\\x\in(0,\infty)}}{F(x)} =-\lim_{\substack{x\to0\\x\in(0,\infty)}}{F\circ g(x)}=-\lim_{\substack{x\to0\\x\in(0,\infty)}}{\int_{1}^{1/x}{f}}.$$ I'm just going to skip doing the case for $$x<0$$ because I've spent the last 3 hours(!) writing this $$\square$$.

I also don't know how to prove the last equality in eq. $$(3)$$, but it isn't relevant to my main question, but I hope this illustrates my difficulty in proving everything as rigorously as possible.

Hence I ask, when can I sidestep all of the above rigor and safely do the $$du = -dt/t^2$$ equation gymnastics, treating these quantities like they're numbers and re-arranging them and substituting them with impunity?

The formal statement of the Theorem "Integration by Subsitution" states, that for $$I\subset \mathbb{R}, f:I\to \mathbb{R} \text{ continuous}, \phi :[a,b]\subset \mathbb{R} \to \mathbb{R} \text{ differentiable, and } \phi([a,b])\subset I$$, $$\int\limits_{a}^bf(\phi(x))\phi'(x)\text{dx}=\int\limits_{\phi(a)}^{\phi(b)}f(u)\text{du}$$
Notice, that this is equivalent to substituting $$u=\phi(x)$$, and replacing $$\phi'(x)\text{dx}$$ with du. Therefore you can just treat dx and du like variables by substituting them for your Integral.
PS: For (3), substitute $$x=\frac{1}{x}$$