Suppose $P(x)$ is a polynomial with real coefficients satisfying the condition $P(\cos \theta + \sin \theta) = P(\cos \theta − \sin \theta)$ Suppose $P(x)$ is a polynomial with real coefficients satisfying the condition $P(\cos \theta + \sin \theta) = P(\cos \theta − \sin \theta)$ for every real $\theta.$ Prove that $P(x)$ can be expressed in the form $$P(x)=a_0+a_1(1-x^2)^2+a_2(1-x^2)^4+...+a_n(1-x^2)^{2n}$$ for some real numbers $a_0, a_1, a_2, \dots , a_n $ and some nonnegative integer $n$.
 A: Notice that
$$(\cos\theta+\sin\theta)^2+(\cos\theta-\sin\theta)^2=2$$
so that
$$P(x)=P(\sqrt{2-x^2})$$
or 
$$P(\sqrt z)=P(\sqrt{2-z}).$$
Hence, $P(\sqrt z)$ is symmetrical around $z=1$.
$$P(x)=P(\sqrt z)=\sum_{k=0}^{2n}a_k(1-z)^{2k}=\sum_{k=0}^{2n}a_k(1-x^2)^{2k}.$$
A: Next to the answer of Yves Daoust, I would like to write a somewhat longer answer, to provide another perspective.
First note that we can insert $\theta+\pi/2$ into $$P(\cos\theta+\sin\theta)=P(\cos\theta-\sin\theta)$$ which gives $P(-\sin\theta+\cos\theta)=P(-\sin\theta-\cos\theta)$. From this follows that around $x=0$, we have $P(x)=P(-x)$, and because $P$ is a polynomial we have $$P(x)=P(-x)$$ for all $x\in\mathbb{R}$.
Secondly, the derivative of $P(\cos\theta\pm\sin\theta)$ with respect to $\theta$ is $P'(\cos\theta\pm\sin\theta)\cdot\left(-\sin\theta\pm\cos\theta\right)$. Because of the equality $P(\cos\theta+\sin\theta)=P(\cos\theta-\sin\theta)$, it follows for $\theta=0$ that $P'(1)\cdot(1)=P'(1)\cdot(-1)$ and for $\theta=\pi$ it follows that $P'(-1)\cdot(-1)=P'(-1)\cdot(1)$. From this follows that $$P'(1)=P'(-1)=0.$$
With the two results from above, we can start an algorithm. Let $P$ be a polynomial such that $P(\cos\theta+\sin\theta)=P(\cos\theta-\sin\theta)$:


*

*Without loss of generality it can be assumed that $P(1)=P(-1)=0$: if this is not the case, consider $P(x)-P(1)$ instead. Because $P(x)=P(-x)$, we have $P(1)=P(-1)$, and subtracting a constant function does not change the property of $P$ which is given.

*Since we have $P(1)=P(-1)=P'(1)=P'(-1)=0$, we can divide $P$ by $(1-x^2)^2$, which gives a polynomial of a strictly smaller degree than before.


If the steps above are repeated, the algorithm will terminate (since $P$ has finite degree), and we get the desired expression for $P$.
