Suppose I want to evaluate $\int_{0}^{1} x^3+2 dx$.
According to the Theorem in Rudin,
My issue is, Rudin says the theorem for only monotone increasing functions. In real life I see people do the following all the time:
Change variables to $\phi(x)=-x$
Then $\int_{0}^{1} x dx=\int_{\phi(0)}^{\phi(1)} \phi(x)^3 +2 d\phi(x)=\int_{0}^{-1} -x^3+2 (-dx)=\int_{-1}^{0} -x^3+2 dx$
I have checked that both these integrals give the same answer: $\frac{9}{2}$
How can I rigorously and systematically understand why this works? I am frustrated because changing variables in practice has been something that I always struggled with, so I wish to devise a fool-proof way to successfully change variables on the fly.
Thanks!

The theorem actually holds without any monotonicity assumption on $\phi$. See this Wikipedia page for example for a more general statement and its proof. (I assume that the more general statement appears later in Rudin's book as well.)
This is great because you don't even have to check monotonicity before using a substitution of this type.