Solution 1:

Here is how,

$$ \int_{-\pi}^{\pi}\left|\sum_{n=1}^{\infty}\frac{1}{2^{n}}e^{inx}\right|^{2}dx = \sum_{n=1}^{\infty}\frac{1}{2^{n}}\sum_{m=1}^{\infty}\frac{1}{2^{m}} \int_{-\pi}^{\pi} e^{i(n-m)x}dx .$$

Now, see here for details and how to finish the problem. Another related technique.