How to prove $\int_{\Omega} \sum_{i=1}^{N} f_i(x)dx$ is equivilant with $\sum_{i=1}^{N} \int_{\Omega} f_i(x)u_i(x)dx$ I have a 2D image defined on a region $\Omega$. Assume that the region can be separated into $N$ sub-regions $\Omega_i$ such that $$\forall i,j=1... N:\Omega_i \cap\Omega_j=\emptyset$$ and $$\bigcup_{n=1}^{N}\Omega_n =\Omega$$

Let $u_i(x)=1$ if $x \in \Omega_i$, otherwise $u_i(x)=0$. Then for a familiy $\{f_n:n\in 1..N\}$ of functions on $\Omega$ we have $$x \in \Omega_k \implies \sum_{i=1}^{N}f_i(x)u_i(x)=f_k(x)$$

I have a energy function that is defined as following
$$E_1=\int_{\Omega} \sum_{i=1}^{N} f_i(x)dx$$

Does the below equation $E_2$ equate with above energy function $E_1$? How to prove it?
$$E_2=\sum_{i=1}^{N} \int_{\Omega}  f_i(x)u_i(x)dx$$ 

That is my prove
Starting from your $E_2$ and exchanging the finite sum with the integral we get this:

$$E_2=\sum_{i=1}^N \int_\Omega f_i(x) u_i(x) dx = \int_\Omega \sum_{i=1}^N f_i(x) u_i(x) dx$$

Next we can use the disjoint cover $\{\Omega_i\}$ of $\Omega$ to split up the integral:

$$E_2 = \sum_{k=1}^N \int_{\Omega_k} \sum_{i=1}^N f_i(x) u_i(x) dx$$

The $x$ in the integral are now from $\Omega_k$ and we can apply your identity for the sum over $f_i(x) u_i(x)$:

$$E_2 = \sum_{k=1}^N \int_{\Omega_k} f_k(x) dx$$

This is almost your $E_1$, but not quite. We cannot exchange the integral with the sum because the integral depends on the summation index. Extending the integration region to $\Omega$ is also not possible without reintroducing a selection function. So your $E_1$ and $E_2$ are not equal. The closest thing to $E_1$ is what I have derived above.