Can I switch the order of integration and "Real(z)" operation? Let $f(z,\eta)$ be an entire function.
I need to calculate (numerically) the integral: $$\int\limits _{0}^{\pi}\mbox{Re}\left(\int\limits _{0}^{\pi}f\left(z,\eta\right)d\eta\right)dz$$
Can I switch the inner order and calculate the next integral instead? $$\mbox{Re}\left[\int\limits _{0}^{\pi}\int\limits _{0}^{\pi}f\left(z,\eta\right)d\eta dz\right]$$
 A: Yes, due to the linearity of integration.

The justification is as follows: Define $F(z) = \int_0^\pi f(z, \eta) \, d\eta$. Then $F(z) = F_1(z) + i F_2(z)$ where $F_1(z) = \Re F(z)$ and $F_2(z) = \Im F(z)$. On one hand we have 
\begin{align}
\int_0^\pi \Re \left( \int_0^\pi f(z, \eta) \, d\eta \right) \, dz &= \int_0^\pi \Re F(z) \, dz \\
&= \int_0^\pi F_1(z) \, dz.
\end{align}
On the other hand we have
\begin{align}
\Re \left( \int_0^\pi \int_0^\pi f(z, \eta) \, d\eta \, dz \right) &= \Re \left( \int_0^\pi F(z) \, dz \right) \\
&= \Re \left( \int_0^\pi (F_1(z) + i F_2(z)) \, dz \right) \\
&= \Re \left( \int_0^\pi F_1(z) \, dz + i \int_0^\pi F_2(z) \, dz \right).
\end{align}
Since $F_1(z)$ and $F_2(z)$ are real, and since they are integrated on the interval $[0, \pi] \subset \mathbb{R}$, the two definite integrals are real. Therefore
$$ \Re \left( \int_0^\pi F_1(z) \, dz + i \int_0^\pi F_2(z) \, dz \right) = \int_0^\pi F_1(z) \, dz $$
Therefore the original two expressions are equal, as claimed.
