Show that $ f(\theta) = | \sum_{k=0}^n b_k e^{ik \theta} | ^2$ when $ f(\theta) = \sum_{k=0}^n a_k \cos(k \theta) \geq 0$ Let  $f(\theta) = \sum_{k=0}^n a_k \cos(k \theta)$ for real numbers $(a_k)$. Assume that $\forall \theta \in \mathbb{R},f(\theta) \geq 0$. How can you show that there exist complex numbers $(b_k)$ such that $ f(\theta) = | \sum_{k=0}^n b_k e^{ik \theta} | ^2$ ?
 A: I have used $x$ in place of $\theta $. Assume first that $f(x)>0$ for all $x$. Let $p(z)=z^{N}\sum_{j=-N}^{N}c_{j}z^{j}$ where $f(x)=\sum_{j=-N}^{N}c_{j}e^{ijx}.$ Then $g$ is an entire function. Note that $
z^{2N}[p(\frac{1}{\overset{-}{z}})]^{-}=z^{2N}\frac{1}{z^{N}}%
\sum_{j=-N}^{N}\overset{-}{c_{j}}\frac{1}{z^{j}}=\sum_{j=-N}^{N}\overset{-}{c_{j}}z^{N-j}=\sum_{j=-N}^{N}\overset{-%
}{c_{-j}}z^{N+j}=\sum_{j=-N}^{N}c_{j}z^{N+j}=p(z)$
Since $f$ is
real valued we have $$\sum_{j=-N}^{N}c_{j}e^{ijx}=\sum_{j=-N}^{N}\overset{-}{c_{j}}e^{-ijx}=\sum_{j=-N}^{N}\overset{%
-}{c_{-j}}e^{ijx}$$ which implies $\overset{-}{c_{-j}}=c_{j}$ for all $j$].
Thus, $p(z)=0,z\neq 0\Rightarrow p(\frac{1}{\overset{-}{z}})=0$. It follows
that $p(z)=c\prod_{j}(z-a_{j})(z-\frac{1}{\overset{-}{a_{j}}})$ for
some none-zero complex numbers $\{a_{i}\}$ with $c\neq 0$ if we assume, as
we may, that $c_{N}\neq 0$. [ The case $c_{-N}\neq 0$] is similar]. Now $%
e^{-iNx}p(e^{ix})=f(x)$ and hence $$f(x)=e^{-iNx}c\prod_{j}(e^{ix}-a_{j})(e^{ix}-\frac{1}{\overset{-}{a_{j}}}%
)=de^{ikx}\prod_{j}(a_{j}-e^{ix})(\overset{-}{a_{j}}%
-e^{-ix})=de^{ikx}\prod_{j}\left\vert (e^{ix}-a_{j})\right\vert ^{2}$$
and $k$ is necessarily $0$ because $f$ is non-negative. It follows that $
f=\left\vert g\right\vert ^{2}$ where $g=\sqrt{d}\prod_{j}(e^{ix}-a_{j})$. Now suppose $f$ is allowed to vanish at some
points. Then for each $n\geq 1$ there is a trigonometric polynomial $g_{n}$
such that $f+\frac 1 n=\left\vert g_{n}^{2}\right\vert $. The degree of $g_{n}$ is at
most $N/2$, so we may write $g_{n}=\sum_{j=-N}^{N}c_{j,n}e^{ijx}$.
Since $\sum_{j=-N}^{N}\left\vert c_{j,n}^{2}\right\vert =\left\Vert
g_{n}\right\Vert _{2}^{2}=\frac{1}{2\pi }\int_{-\pi }^{\pi }[f(x)+%
\frac{1}{n}]dx$ we see that the bounded sequence $%
\{(c_{-N,n},c_{-N+1,n},...,c_{0,n},....,c_{N,n})\}$ has a convergent
subsequence in $
\mathbb C^{2N+1}$ and so $g_{n}^{\prime }s$ converge uniformly to a trigonometric
polynomial $g$ and we have $f=|g|^{2}$.
