# Non-negative trigonometric polynomials to exponential form

I've been working on an exercise and have gotten stuck:

Suppose that $$T(x)=\sum_{n=0}^N a_n\cos(2\pi nx)+b_n\sin(2\pi nx)$$ is non-negative on $$[0,1]$$. Show that there exist $$c_0,...,c_N\in \mathbb{C}$$ such that $$T(x)=\left|\sum_{n=0}^{N}c_n \exp(2\pi inx) \right|^2.$$

My strategy was to expand the argument using $$|z|^2=z\bar{z}$$. Equating coefficients and working from the largest value $$N$$ first, I obtained $$a_N \cos(2N\pi x)+b_N\sin(2N\pi x)=c_N\bar{c_0}\exp(2N\pi ix)+\overline{c_N\bar{c_0}}\exp(-2N\pi ix)$$ If we call $$c_N\bar{c_0}=u-iv$$, for instance, then we get equality if $$u=a_N/2$$ and $$v=b_N/2$$. Thus, upon choosing $$c_0$$, for instance, one can solve for $$c_N$$ to get these terms to match up. Now, looking at the $$N-1$$ term, we get $$a_N \cos(2N\pi x)+b_N\sin(2N\pi x)=(c_N\bar{c_1}+c_{N-1}\bar{c_0})\exp(2N\pi ix)+\overline{(c_N\bar{c_1}+c_{N-1}\bar{c_0})}\exp(-2N\pi ix)$$ Again, calling the coefficient $$c_N\bar{c_1}+c_{N-1}\bar{c_0}=u-iv$$, we get equality if $$u=a_{N-1}/2,v=b_{N-1}/2$$. Since $$c_N$$ and $$c_{N-1}$$, are known, this comes down to solving $$c_N\bar{c_1}+c_{N-1}\bar{c_0}=a_{N-1}/2-ib_{N-1}/2$$ Equating real and imaginary parts, this gives us an inhomogeneous system of 2 linear equations to solve. This is where I'm stuck; I haven't used the (clearly necessary) hypothesis that $$T\geq 0$$, and I'm assuming it will somehow imply that the system has a solution (in which case we could iterate this method and get systems of 2 equations for smaller values of $$n$$ as well), but I can't see how. I also suspect that the freedom to choose $$c_0$$ might be important. I'd appreciate any advice on if this method seems viable, or if there is an easier way to do this exercise.