# Fourier series for $\sin^n(x)$

I am trying to find the Fourier series for $\sin^a(x)$ where $a$ is an arbitrary integer $\ge1$. Here is what I have done so far:

$$\sin^a(x)= \left(\frac{e^{ix}-e^{-ix}}{2i}\right)^a=(2i)^{-a}(e^{ix}-e^{-ix})^a$$

Fourier series: $\frac{1}{2\pi} \sum_{-\infty}^{\infty} c_n e^{inx}$

\begin{align} c_n & =\frac{1}{2\pi} \int_{-\pi}^{\pi} f(x) e^{-inx} \, dx \\[10pt] & =\frac{1}{2\pi} \int_{-\pi}^{\pi} (2i)^{-a}(e^{ix}-e^{-ix})^a e^{-inx} \, dx \\[10pt] & =\frac{1}{2\pi} (2i)^{-a} \int_{-\pi}^{\pi} e^{-inx} \sum_{k=0}^a \binom{a}{k} e^{(a-k)ix} e^{-kix} (-1)^k \, dx \\[10pt] & =\frac{1}{2\pi} (2i)^{-a} \left[ \sum_{k=0}^a \binom{a}{k} (-1)^k \frac{1}{(a-2k-n)i} e^{(a-2k-n)ix} \right]_{-\pi}^\pi \\[10pt] & =\frac{1}{2\pi} (2i)^{-a} \sum_{k=0}^{a} \binom{a}{k} (-1)^k \frac{1}{(a-2k-n)i} (e^{(a-2k-n)i\pi} - e^{-(a-2k-n)i\pi}) \\[10pt] & =\frac{1}{2\pi} (2i)^{-a} \sum_{k=0}^{a} \binom{a}{k} (-1)^k \frac{1}{(a-2k-n)i} ((-1)^{(a-2k-n)} - (-1)^{-(a-2k-n)}) \\[10pt] & =0 \end{align}

At this point I strongly feel that I have done something wrong. The only idea I have is that $e^{(a-2k-n)ix})=1$ for $(a-2k-n)=0$. Which makes me evaluate the integral incorrectly, since there should be an $x$ term before plugging in $\pi$ and $-\pi$. I do feel like I am missing something, and would be grateful for any advice.

You have $$\sum_{k=0}^a \binom a k (-1)^k \int_{-\pi}^\pi e^{ix(a-n-2k)} \, dx.$$ And then $$\int_{-\pi}^\pi e^{ix(a-n-2k)} \, dx = \begin{cases} 0 & \text{if } a-n-2k \ne 0, \\ 2\pi & \text{if } a-n-2k=0. \end{cases}$$ In the sum $\displaystyle \sum_{k=0}^a,$ for which values of $k$ in the range $0,1,2,\ldots,a$ is $a-n-2k$ equal to $0\text{?}$