Do you agree that ∫BAf(x)dx≡∫BAf(y)dy\int_{A}^{B} f(x)\, dx \equiv \int_{A}^{B} f(y)\, dy?
Is it clear to you that II is not a function, but a single constant value defined by the integral ∫∞−∞e−x2dx\int_{-\infty}^{\infty} e^{-x^2} \, dx?
Would it not be equally true that I=∫∞−∞e−y2dy=∫∞−∞e−t2dtI=\int_{-\infty}^{\infty} e^{-y^2} \, dy=\int_{-\infty}^{\infty} e^{-t^2} \, dt?
These facts require no substitution, since II is still defined as the constant value given by the integral of the function f(x)=e−x2f(x)=e^{-x^2} over all real values.
It seems that where you get confused is when we are defining I2I^2.
For this, recall that multiplying two integrals is like multiplying two sums, and you must take care to ensure that all crossed products are considered.
When doing this with sums, you might see something like:
(∑ni=1i)2=(∑ni=1i)(∑ni=1i)\left( \sum_{i=1}^n i \right)^2 = \left( \sum_{i=1}^n i \right)\left( \sum_{i=1}^n i \right)
=(∑ni=1i)(∑nj=1j)=∑ni=1∑nj=1ij= \left( \sum_{i=1}^n i \right)\left( \sum_{j=1}^n j \right)= \sum_{i=1}^n \sum_{j=1}^n i j
Note that if you fail to change the index variable (similar to the variable of integration), you would get:
(∑ni=1i)2=∑ni=1∑ni=1i2=n∑ni=1i2\left( \sum_{i=1}^n i \right)^2 = \sum_{i=1}^n \sum_{i=1}^n i^2 = n \sum_{i=1}^n i^2
A simple check with n=2 shows that the first representation is correct and the second is not.
(1+2)^2 = 9 = 1*1 + 1*2 + 2*1 + 2*2
not 2( 1+4) = 10
It is not just that it does not change anything to change the variable, it is that it is required to change the variable if you want to write the product in a combined expression.