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$$