I'm trying to solve exercise 5 in chapter 14 of Rudin's Real & Complex Analysis:
Suppose $f$ is a trigonometric polynomial, $$f(\theta) = \sum_{k=-n}^n a_k e^{ik\theta}$$ and $f(\theta) > 0$ for all real $\theta$. Prove that there is a polynomial $P(z) = c_0 + c_1z + ... + c_nz^n$ such that $f(\theta)= |P(e^{i\theta})|^2$ ($\theta$ real).
I've made good progress but I can not finish it. My thoughts:
Define $F(z) = \sum_{k=-n}^n a_k z^k$. This is a rational function that is positive on the unit circle so it must be of the form: $$F(z) = c \prod_{j=1}^n\frac{(z-\beta_j)(1-\overline\beta_j z)}{(z-\gamma_j)(1-\overline\gamma_j z)}$$
where $c > 0$. $\beta_j$ are zeros of $F$. $\gamma_j$ are poles.
On the unit circle $$f(\theta) = F(e^{i\theta}) = c \prod_{j=1}^n\frac{(e^{i\theta}-\beta_j)(1-\overline\beta_j e^{i\theta})}{(e^{i\theta}-\gamma_j)(1-\overline\gamma_j e^{i\theta})}$$
The terms in the product simplify to $$\left| \frac{e^{i\theta} - \beta_j}{e^{i\theta} - \gamma_j} \right|^2$$
If I can show that this is a polynomial, I'll solve the exercise, but it doesn't look like a polynomial to me.
Is there a better way?