TITLE: Which polynomials fix the unit circle?
QUESTION [20 upvotes]: Find all polynomials $P(x)$ with real coefficients such that for every $x,y\in \mathbb{R}$ satisfying $x^2+y^2=1$ we have
$$P(x)^2+P(y)^2=1$$

REPLY [7 votes]: Here is a "simple" solution.

Lemma.
  Consider a polynomial
  $Q \in\mathbb{C}[X]$ 
   such that $|{Q(e^{it})}|=1$ for  $t\in\mathbb{R}$. Then $Q(X)=\lambda X^n$ for some nonnegative integer $n$, and some
   complex $\lambda$ with $|\lambda|=1$.

Proof.
Clearly $Q$ is not zero, so, let $d=\deg Q$, and suppose that
$$
Q(X)=a_0+a_1X+\cdots+a_d X^d.
$$
Also, let  $m=\mathop{\rm val}(Q)=\min\{k\leq d: a_k\ne 0\}$.
Suppose that $m<d$. The coefficient of $e^{i(d-m)t} $ in the expansion of $|Q(e^{it})|^2$ is $a_d\overline{a_m}$, so
$$
a_d\overline{a_m}=\frac{1}{2\pi}\int_0^{2\pi}
|{Q(e^{it})}|^2e^{i(m-d)t}\,dt=
\frac{1}{2\pi}\int_0^{2\pi}
e^{i(m-d)t}\,dt=0
$$
which is absurd since $a_d\ne 0$ and $a_m\ne 0$.
It follows that $d=m$ so we can take $n=d$, $\lambda=a_d$, and the lemma is proved.
$\qquad\square$
$\qquad$ Consider a polynomial $P(X)\in\mathbb{R}[X]$ that satisfies the proposed condition. That is
$$
\forall\, t\in \mathbb{R},\quad \left|P(\cos t)+iP\left(\cos\left(t-\frac{\pi}{2}\right)\right)\right|=1$$
Now, let $d=\deg P$, then 
there are $(b_0,b_1,\ldots,b_d)\in\mathbb{R}^{d+1}$, such that
$$
P(X)=\sum_{k=0}^d b_kT_k(X)
$$
where $T_k$ is the Chebyshev polynomial of the first kind and degree $k$. (because Chebyshev's polynomials of the first kind constitute a basis for $\mathbb{R}[X]$.)
Now, if $q(t)=P(\cos t)+iP\left(\cos\left(t-\frac{\pi}{2}\right)\right)$ then
\begin{align*}
q(t)&=\sum_{k=0}^db_k(\cos(kt)+i\cos(kt-k\pi/2))\\
&=(1+i)b_0+\frac{1}{2}\sum_{k=1}^db_k\left(e^{ikt}+e^{-ikt}\right)
+\frac{i}{2}\sum_{k=1}^db_k\left(i^{-k}e^{ikt}+i^ke^{-ikt}\right)\\
&=(1+i)b_0+\frac{1}{2}\sum_{k=1}^db_k(1+i^{1-k}) e^{ikt}
+\frac{1}{2}\sum_{k=1}^db_k(1+i^{1+k}) e^{-ikt} \\
&=e^{-idt}Q(e^{it})
\end{align*}
where 
$$
Q(X)=\frac{1}{2}\sum_{k=1}^db_k(1+i^{1+k}) X^{d-k}
+(1+i)b_0X^d+\frac{1}{2}\sum_{k=1}^db_k(1+i^{1-k}) X^{d+k}
$$
By assumption we have $|{Q(e^{it})}|^2=1$ and, according to the Lemma, $Q$ must be a monomial. So, we have one of the following cases:

$|{(1+i)b_0}|=1$ and $b_1=\ldots=b_n=0$. This corresponds to $P(X)=\pm\frac{1}{\sqrt{2}}T_0(X)$. (because $b_0$ is real).
For some $k\in\{1,\ldots,d\}$ we have $|{b_k(1+i^{1+k})}|=2$,  $|{b_k(1+i^{1-k})}|=0$, and the other $b_j$'s are $0$. Since 
$b_k\ne0$ the second condition implies that $k=3\pmod{4}$ and replacing in the first we get $b_k=\pm1$. So in this case $P(X)=\pm T_k(X)$ for some $k=3\pmod{4}$.
For some $k\in\{1,\ldots,d\}$ we have $|{b_k(1+i^{1-k})}|=2$,  $|{b_k(1+i^{1+k})}|=0$, and the other $b_j$'s are $0$. Again, the second condition implies that $k=1\pmod{4}$ and replacing in the first we get $b_k=\pm1$. So in this case $P(X)=\pm T_k(X)$ for some $k=1\pmod{4}$.

Finally, we have proved that either $P(X)=\pm\frac{1}{\sqrt{2}}$ or $P(X)=\pm T_{k}$ for some odd integer $k$. The converse is trivially true since the converse of the Lemma is trivial. Done.