I have a question regarding substitution of differentials when no integral is present. A few days ago, I asked a question on the physics site, but the question I posted has evolved into a math question that I feel is more fitting here. The original post can be found here: https://physics.stackexchange.com/questions/341596/bounds-of-integration-with-respect-to-something-that-is-not-time
As explained in that post, I was confused about the bounds of integration for a certain function. Specifically, I was confused as to why the bounds were $\int_{R+a}^{R-a}dr$ as opposed to $\int_{R-a}^{R+a}dr$. I learned that this was a result of substitution: the $dr$ was substituted in for the $dx$, and the bounds in terms of $x$ were transformed into $R+a$ and $R-a$ for $r$. I am still confused about this, however.
I am used to performing substitutions when integrals are present (for example, in u-substitution). However, Feynman makes a substitution for $dx$ before any integral is used. My question is, how would one know that the new equation in terms of $dr$ came from another equation (in terms of $dx$)? If I were just given the equation with $dr$, I would make the bounds of integration: $\int_{R-a}^{R+a}dr$ (low to high), but knowing the original equation in terms of $dx$, this is wrong. How are mathematicians able to keep track of all these substitutions and how they affect the bounds (for example, what happens if there were more substitutions; how would one keep track of all of those)? Thank you!