This question is partially inspired by Qiaochu Yuan's answer to "Will moving differentiation from inside, to outside an integral, change the result?".
Essentially, I would like to know, if we have:
$$\sum_{x=a}^b{ \int{ f(x)dx } } \quad\text{ or }\quad \sum_x{ \int{ f(x)dx } }$$
If we then perform a substitution $\int{ f(x)dx } \to \int{ g(y) dy}$, when can we carry the substitution over to the summation? In other words, when does
$$\sum_{x=a}^b{ \int{ f(x)dx } } = \sum_{y=a_2}^{b_2}{ \int{ g(y)dy } }$$
I'm hoping that someone can cover as much as possible.
I'm wondering how we would derive the new constants of summation as well.