Expand $\cos^n (x)$ in terms of $\cos{kx}$, $k=1,\dots,n$. Is it possible to expand $\cos^n(x)$ as a function of $\cos(kx)$? i.e. if $\cos^n (x)$ can be expanded as the following series
$$
\cos^n (x) = \sum_{k=0}^{n} a_k \cos{kx}
$$
then what are the constants $a_k$? If not, is there any way to recover $a_0$ for any $n$?
 A: For odd $n$,
$$\cos^n x=\left(\frac{e^{ix}+e^{-ix}}2\right)^n=\frac1{2^n}\sum_{k=0}^n\binom nke^{ikx}e^{-i(n-k)x}=\frac1{2^n}\sum_{k=0}^n\binom nke^{i(2k-n)x}\\
=\frac2{2^n}\sum_{k=(n+1)/2}^n\binom nk\cos(2k-n)x.$$
For even $n$, the development is very similar, but for the middle term.
A: Since $f(x) = \cos^n x$ is even and smooth on $[-\pi,\pi]$ is has a
Fourier cosine series 
$f(x) = {c_0 \over 2} + \sum_k c_k \cos (kx)$ where
$c_k = {2 \over \pi} \int_0^\pi \cos^n x \cos(kx) dx$.
Since $\cos^n x = {1 \over 2^n} (e^{ix}+e^{-ix})^n$, we see that for
$k >n$ we have $c_k = 0$.
We see that $a_0 = {c_0 \over 2} = {1 \over \pi} \int_0^\pi \cos^n x dx$.
It should be clear (by integrating over $[0, {\pi \over 2}]$ and $[ {\pi \over 2},1]$ separately)
that for odd $n$ that $a_0 = 0$.
When $n$ is even, combine the binomial theorem with Euler's formula
to get
$a_0 = {1 \over 2^n \pi} \int_0^\pi \binom{n}{k}e^{i(n-2k)x} dx = {1 \over 2^n} \binom{n}{n \over 2}$.
A: You can use the Fourier series expansion. Since the function $cos^n(x)$ is even it is written in even terms of the Fourier series, i.e. $cos(kx)$ in the domain of $[-\pi,\pi]$. The Fourier series uses orthogonal functions $cos(kx)$ and $sins(kx)$ meaning that using the integral as an inner product you will have:
$$\int\limits_{-\pi}^{\pi}cos(qx)cos(px)dx = \pi\delta_{qp},\quad q,p\geq1$$
$$\int\limits_{-\pi}^{\pi}sin(qx)sin(px)dx = \pi\delta_{qp},\quad q,p\geq1$$
$$\int\limits_{-\pi}^{\pi}sin(qx)cos(px)dx = 0$$
In order to find the $a_k$ coefficient in your sum it is needed to calculate the integral
$$a_k = 1/\pi\int\limits_{-\pi}^{\pi}cos^n(x)cos(kx)dx$$
More about Fourier series is found in here.
