In Riemann zeta function functional equation proof I arrived to a following equation $$\frac{\Gamma\left(\frac{s}2\right) \zeta(s)}{\pi^{\frac{s}2}}=\sum_{n=1}^\infty \int_0^\infty x^{\frac{s}2-1}e^{-n^{2}\pi x}dx,$$ where $s\in \mathbb{C}$ and Re$(s)>1$. Next step is to prove that $$\frac{\Gamma\left(\frac{s}2\right) \zeta(s)}{\pi^{\frac{s}2}}=\int_0^\infty x^{\frac{s}2-1}\sum_{n=1}^\infty e^{-n^{2}\pi x}dx.$$
Why exactly can we change the order of integration and summation? I'm having trouble with this equation, since $s\in \mathbb{C}$. What exactly should I use?