I was always told to change the terminals when the variable itself changed.
Consider the following problem
We can see that is the derivative of therefore we make
As the terminals x = 2,3 are with respect to x and our substituted variable is u we use
to change them.
And now we have
Is this helpful?