Fourier transform of $f(x) = \chi\cos^n(\pi x)$ I ran across an abandon post from 2013 where the OP has no work shown but just a problem statement. The OP was last seen May 2013 so I doubt they will be returning to edit their post with relevant work. However, the problem seems interesting so I am posting it with my own work. The original post can be found here
. On the post, @DilipSarwate comments saying write cosine in exponential form and use the Binomial theorem.

We are trying to find the Fourier transform of 
$$
f(x) = \chi\cos^n(\pi x)
$$
where $n\in\mathbb{N}$, $x\in\mathbb{R}$, and 
$$
\chi = \begin{cases} 1, & -1/2 <x< 1/2\\
0, & x\not\in (-1/2, 1/2)
\end{cases}
$$
Using the following defintion, $\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}f(x)e^{i\omega x}dx$, we have
\begin{align}
\frac{1}{\sqrt{2\pi}}\int_{-1/2}^{1/2}\cos^n(\pi x)e^{i\omega x}dx &= 
\frac{1}{\sqrt{2\pi}}\int_{-1/2}^{1/2}\Bigl[\sum_{k=0}^n\frac{1}{2^n}\binom{n}{k}e^{i\pi x(n-k)}e^{-i\pi xk}\Bigr]e^{i\omega x}dx\\
&= \frac{1}{\sqrt{2\pi}}\int_{-1/2}^{1/2}\sum_{k=0}^n\frac{1}{2^n}\binom{n}{k}\exp\bigl[i(\pi n - 2\pi k + \omega)x\bigr]dx
\end{align}
Can we swap the sum and integral here? If so, we have

$$
\frac{1}{\sqrt{2\pi}}\sum_{k=0}^n\frac{1}{2^n}\binom{n}{k}\int_{-1/2}^{1/2}\exp\bigl[i(\pi n - 2\pi k + \omega)x\bigr]dx = 
\frac{1}{\sqrt{2\pi}}\sum_{k=0}^n\frac{1}{2^n}\binom{n}{k}\frac{2\sin\bigl[1/2(\pi n - 2\pi k + \omega)\bigr]}{\pi n - 2\pi k + \omega}
$$
From Mathematica, I know that sum evaluates to 
$$
\sum = -\frac{ n! \sin \bigl(\frac{1}{2} (\pi  n+\omega )\bigr) \Gamma \bigl(-\frac{\pi  n+\omega }{2 \pi }\bigr)}{2^n\pi  \Gamma \Bigl[(\frac{1}{2} \bigl(n-\frac{\omega }{\pi }+2\bigr)\Bigr]}
$$
but I don't know how to evaluate it analytically. This whole part was under the assumption the sum and integral can be interchanged.
 A: Since $n$ is finite, there is just a finite sum. Therefore it is allowed to interchange the summation and integration.
To calculate the summation, we start with this, without having interchanged summation and integration:
\begin{align}
\sum&=\int_{-1/2}^{1/2}\sum_{k=0}^n\frac{1}{2^n}\binom{n}{k}\exp\bigl[i(\pi n - 2\pi k + \omega)x\bigr]dx\\
&=\int_{-1/2}^{1/2}\frac{1}{2^n}\left[\sum_{k=0}^n\binom{n}{k}e^{-2i\pi kx}\right]e^{i(n\pi+ \omega)x}dx\\
&=\frac{1}{2^n}\int_{-1/2}^{1/2}(1+e^{-2i\pi x})^ne^{i(n\pi+ \omega)x}dx\equiv \frac{1}{2^n}I(n,n\pi+\omega)\\
&=\frac{1}{2^n}\int_{-1/2}^{1/2}(1+e^{-2i\pi x})^n\left[\frac{e^{i(n\pi+ \omega)x}}{i(n\pi+\omega)}\right]'dx\\
&=\frac{1}{2^n}\left[(1+e^{-2i\pi x})^n\frac{e^{i(n\pi+ \omega)x}}{i(n\pi+\omega)}\right]_{-1/2}^{1/2}+\frac{1}{2^n}\int_{-1/2}^{1/2}2in\pi e^{-2i\pi x}(1+e^{-2i\pi x})^{n-1}\left[\frac{e^{i(n\pi+ \omega)x}}{i(n\pi+\omega)}\right]dx\\
&=\frac{1}{2^n}\frac{2\pi n}{n\pi+\omega}\int_{-1/2}^{1/2}(1+e^{-2i\pi x})^{n-1}e^{i(n\pi+\omega-2\pi)x}dx\\
&=\frac{1}{2^n}\frac{2\pi n}{n\pi+\omega}I(n-1,(n-2)\pi+\omega)
\end{align}
Repeating this $n$ times, it follows:
\begin{align}
I(n,n\pi+\omega)&=n!\prod_{k=0}^{n-1}\frac{1}{\frac{\omega}{2\pi}+\frac{n}{2}-k}I(0,\omega-n\pi)\\
&=n!\prod_{k=0}^{n-1}\frac{-1}{k-\frac{\omega}{2\pi}-\frac{n}{2}}\int_{-1/2}^{1/2}e^{i(\omega-n\pi)x}dx\\
&=n!(-1)^{n}\prod_{k=0}^{n-1}\frac{1}{k-\frac{\omega}{2\pi}-\frac{n}{2}}\left[\frac{e^{i(\omega-n\pi)x}}{2\pi i(\frac{\omega}{2\pi}-\frac{n}{2})}\right]_{-1/2}^{1/2}\\
&=n!(-1)^{n+1}\prod_{k=0}^{n}\frac{1}{k-\frac{\omega}{2\pi}-\frac{n}{2}}\left[\frac{2i\sin\left(\frac{1}{2}(\omega-n\pi)\right)}{2\pi i}\right]\\
&=n!(-1)^{n+1}\frac{\Gamma(-\frac{\omega}{2\pi}-\frac{n}{2})}{\pi\Gamma(n+1-\frac{\omega}{2\pi}-\frac{n}{2})}\sin\left(\frac{1}{2}(\omega-n\pi)\right)\\
&=n!(-1)^{n+1}\frac{\Gamma(-\frac{\omega}{2\pi}-\frac{n}{2})}{\pi\Gamma(1-\frac{\omega}{2\pi}+\frac{n}{2})}\sin\left(\frac{1}{2}(\omega-n\pi)\right)\\
&=n!(-1)^{n+1}\frac{\Gamma(-\frac{\omega}{2\pi}-\frac{n}{2})}{\pi\Gamma(1-\frac{\omega}{2\pi}+\frac{n}{2})}(-1)^n\sin\left(\frac{1}{2}(\omega+n\pi)\right)\\
\end{align}
Conclusion:
$$\sum=-\frac{n!\Gamma(-\frac{\omega}{2\pi}-\frac{n}{2})}{\pi\Gamma(1-\frac{\omega}{2\pi}+\frac{n}{2})}\sin\left((\frac{1}{2}(\omega+n\pi)\right)$$
