Find all real polynomial $p(x)$ such that $p(\cos\theta) = p(\sin\theta)$ for all $\theta\in [0, 2\pi)$.
This problem comes from a past USA TST, but I couldn't find any solutions online. After spending a lot of time on it, I got nowhere, so if anyone can help, please do so.
I suspect that the only polynomials that are solutions are $p(x) = c$ for some constant $c$.
$f(\theta)=p(\cos\theta)$ is an even function, hence we must have $p(\sin\theta)=p(-\sin\theta)$.
That implies that $p(x)$ is a polynomial in $x^2$, $p(x)=q(x^2)$, and $$ q(\sin^2\theta) = q(\cos^2\theta) = q(1-\sin^2\theta), $$ so $q(z)$ is a polynomial symmetric with respect to $z=\frac{1}{2}$: $$ q(z) = c_0+c_2\left(z-\frac{1}{2}\right)^2 + \ldots + c_{2m}\left(z-\frac{1}{2}\right)^{2m} $$ and $$ p(x) = c_0+c_2\left(x^2-\frac{1}{2}\right)^2 + \ldots + c_{2m}\left(x^2-\frac{1}{2}\right)^{2m}.$$ Since $1,z(1-z),z^2(1-z)^2,z^3(1-z)^3,\ldots$ is a base of the space of polynomials symmetric with respect to $z=\frac{1}{2}$, we may re-write the last line in the more compact way: $$\boxed{\, p(x) = r\!\left(x^2(1-x^2)\right)\quad\text{for some polynomial }r.}$$ It is straightforward to check that this set of polynomials fulfill the given constraints.