Fourier Series: Integral of a Sum or Sum of Integrals? While touching on Fourier series in a PDEs course, our professor basically waved her hands at the concept that
$$
\int_0^a\sum_{n=1}^{\infty}A_n\sin\frac{n\pi}ax\sin\frac{m\pi}ax\,dx=\sum_{n=1}^{\infty}A_n\int_0^a\sin\frac{n\pi}ax\sin\frac{m\pi}ax\,dx=\frac a2A_m,
$$
claiming that an arcane knowledge of real analysis was required to prove this true for certain cases.
That explanation left me completely unsatisfied, as I then began to wonder about the kind of functions for which this is true or false.
I have some knowledge of real analysis, and a reference to this proof or a sketch of it would do wonders at resolving this mental craving that I have had since.
Edit 1: I added integration boundaries.
 A: You are actually considering $L^2$ (or something similar) convergence in this question. Not pointwise convergence. You use Carleson's theorem to extract the pointwise convergence as well.
What you are doing there is expanding the solution in terms of a basis for your space. If your space is $L^2[0, 2\pi]^2$ and your solution is $f$, you write your $f$ with respect to a basis $(e_n)$ of $L^2$ like
$$f(x) = \sum_n a_n e_n(x).$$
The convergence here is understood in the norm, that is$$\left \|f - \sum_{n = -N}^N a_n e_n \right \| \to 0$$
as $N \to \infty$. Your $(e_n)_n$ here are the $e^{i n x}$ as in Fourier series. This is your basis with properties such as
$$\int e_n e_m = \delta_{nm}.$$
Which means this is an orthogonal basis.
Moral: Convergence is not always meant to be pointwise.
A: First of all you need to declare over what region you are taking your integral over. Are you taking it over a closed bounded region? I am also assuming that the integer $m$ is fixed a priori yes? What about the coefficients $A_n$? Do you know anything nice about them (e.g. they are uniformly bounded in $n$)? 
Replace the infinite sum of stuff with $\lim_{k \rightarrow \infty} s_k(x)$ where 
$$s_k(x) = \sum_{n=1}^k A_n \sin(n\pi x/a)\sin(m \pi x/a).$$
Then you are asking why 
$$\int \lim s_k(x) dx= \lim \int s_k(x) dx.$$
There are several circumstances when you can do this:


*

*When the family $s_k(x)$ converges uniformly to something.

*When the family $s_k(x)$ converges pointwise to something and is uniformly bounded (that's why I asked about the coefficients) - this is Arzelà's Dominated Convergence Theorem.
Note that for 1, if you are taking your integral over a compact set then I think it suffices to understand why the family $s_k$ is equicontinuous, which is where we need information about the $A_n$ as well.
A: Sum and integral is interchangable for absolute convergent series of uniformly continuous functions.
