# Uniform convergence on compact sets implies interchange of summation and integration

Suppose there is a non-bounded set $S$ in the complex plain and a sequence of analytic functions $f_n$ defined over $S$.

The series $$f(s)=\sum_{n=1}^{\infty} f_n(s)$$ converges uniformly on compact subsets $K\subset S$. I know that by Weierstrass' Theorem that $f(s)$ is analytic in $S$ and that the series can be differentiated term by term: $$f'(s)=\sum_{n=1}^{\infty}f_n'(s)$$on $S$. Does this imply that$$\int_{S}f(s)ds=\sum_{n=1}^{\infty}\int_Sf_n(s)ds$$ provided each integral exists? If the series converges uniformly on $S$ then the interchange can be done, but if I only have uniform convergence on compact subsets, can I still interchange the sum with the integral? For example if we consider $f_n(s)=e^{-\pi n^2s}$ then it is easy to see that $$\sum _{n=1}^\infty e^{-\pi n^2 s}$$ converges uniformly on compact subsets of the positive real axis $S=\mathbb{R}^+$. However it does not converge uniformly on the entire positive real axis. In this case is the interchange $$\int_0^\infty \sum _{n=1}^\infty e^{-\pi n^2 s}ds=\sum _{n=1}^\infty \int_0^\infty e^{-\pi n^2 s}$$still valid becuase of uniform convergence on compact subsets? (This interchange can be justified by the Dominated Convergence Theorem)

Suppose $S=[0,1).$ Consider the series $z + (2z^2-z)+ (3z^2-2z^2)+ \cdots.$ Then the series converges to $0$ uniformly on compact subsets of $S.$ But the integral of the $n$th partial sum over $S$ is $\int_0^1nx^n\,dx = n/(n+1) \to 1.$