iRaid said:
So you're saying:
a_{m}=\frac{1}{\pi} \displaystyle\sum_{n=1}^{N} a_{n}\:sin\,nx\: \int_{-\pi}^\pi sin\,mx\:dx
NO. You can't take sin(nx) outside the integral, because it depends on x.
It seems like the summation notation is tripping you up, so let's consider a stupid trivial example. What if N = 2? Then:
$$a_{m}=\frac{1}{\pi} \int_{-\pi}^\pi \sum_{n=1}^{2} a_{n}\sin(nx)\sin(mx)\,dx$$
This sum only has two terms. One for n = 1 and one for n = 2. So it's not too tedious to expand the sum in full:
$$ a_m = \frac{1}{\pi}\int_{-\pi}^\pi \left[ a_1 \sin(x)\sin(mx) + a_2\sin(2x)\sin(mx)\right]\,dx$$
Now, recall what I already said before (and something you probably already know):
The integral of a sum of functions is equal to the sum of the integrals of those functions
So our expression above becomes:
$$ a_m = \frac{1}{\pi} \left[ a_1 \int_{-\pi}^\pi\sin(x)\sin(mx)\,dx + a_2\int_{-\pi}^\pi\sin(2x)\sin(mx)\,dx\right]$$
Now, if we were to put this BACK in summation notation, we would write it as:
$$a_m = \frac{1}{\pi}\sum_{n=1}^2 a_n\int_{-\pi}^{\pi} \sin(nx)\sin(mx)\,dx$$
Does that makes sense? That's why you can switch the Ʃ and the ∫ around. Because of this property of integration. The same thing holds for "N" terms in the summation.