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