Find all polynomials satisfying $p(x)p(-x)=p(x^2)$

Let $a_i$ be the roots of $p(x)$. Then the equation states $$ \pm(x-a_1)\ldots(x-a_n)(x+a_1)\cdots(x+a_n)=\pm(x^2-a_1)\cdots(x^2-a_n)$$ The minus sign occurs if the leading coefficient is $-1$ and the degree is odd.

Now, by comparing roots, either $a_1=\pm(a_1)^{1/2}$, i.e. $a_1^2=a_1$, so $a_1=0$ or $1$.

Or $a_1=\pm(a_2)^{1/2}$, $a_2=\pm(a_1)^{1/2}$, so $a_1^4=a_1$, so $a_1=1^{1/3}$ (any of the three roots).

Or, in general, $a_1=\pm(a_2)^{1/2}$, ..., $a_k=\pm(a_1)^{1/2}$, so $a_1^{2^k}=a_1$, and $a_1=\omega_{2^k-1}$ (any $(2^k-1)$th root of $1$). Then $a_2=(\omega_{2^k-1})^2$, $a_3=(\omega_{2^k-1})^4$, etc.

Any polynomial made up of these cycles of roots, with the possible multiplication of $-1$ for odd degrees, is feasible. (It is easily seen that the product of feasible polynomials is again feasible.) For example $$p(x)=x(x-1)(x-\omega_3)(x-\omega_3^2)=x(x-1)(x^2+x+1)$$

Verify: $$p(x)p(-x)=x(x-1)(x-\omega_3)(x-\omega_3^2)(x)(x+1)(x+\omega_3)(x+\omega_3^2)$$

$$p(x^2)=x^2(x^2-1)(x^2-\omega_3)(x^2-\omega_3^2)$$

Edit: This answer is not the same as this answer. For example, \begin{align*}p(x)&=-(x-\omega)(x-\omega^2)(x-\omega^4),\qquad (\omega^7=1)\\ &=1+\tfrac{1+i\sqrt7}{2} x - \tfrac{1-i\sqrt7}{2} x^2 - x^3\end{align*} is feasible but not a cyclotomic polynomial.


Let $p(x)\in\mathbb{C}[x]$ be a polynomial that satisfies the functional equation $$p(x)\,p(-x)=p(x^2)\,.\tag{*}$$ Clearly, $p\equiv 0$ and $p\equiv 1$ are the only constant solutions. Let now assume that $p$ is nonconstant. Hence, the set $Z(p)$ of the roots of $p$ is nonempty.

Suppose that $z\in Z(p)$. Then, $z^2\in Z(p)$ by (*). Hence, we have an infinite sequence $z,z^2,z^{2^2},z^{2^3},\ldots$ of elements of $Z$. However, $Z$ must be a finite set. Therefore, $$z^{2^k}=z^{2^l}$$ for some integers $k$ and $l$ such that $k>l\geq 0$. This means either $z=0$, or $z$ is a primitive root of unity of an odd order.

It is easy to show that, if $m$ is a nonnegative integer such that $x^m$ divides $p(x)$ but $x^{m+1}$ does not, then $$p(x)=(-x)^m\,q(x)\,,$$ where $q(x)\in\mathbb{C}[x]$ also satisfies (*). If $n$ is a nonnegative integer such that $(x-1)^n$ divides $q(x)$ but $(x-1)^{n+1}$ does not, then $$q(x)=(1-x)^n\,r(x)$$ where $q(x)\in\mathbb{C}[x]$ also satisfies (*). We now have a polynomial $r$ satisfying (*) such that $\{0,1\}\cap Z(r)=\emptyset$. If $r$ is constant, then $r\equiv 1$, making $$p(x)=(-x)^m\,(1-x)^n\,.$$

Suppose now that $r$ is nonconstant, so $Z(r)\neq\emptyset$. For each $z\in Z(r)$, let $\theta(z)\in\mathbb{R}/2\pi\mathbb{Z}$ be the angle (modulo $2\pi$) such that $z=\exp\big(\text{i}\,\theta(z)\big)$. Define $\Theta(r)$ to be the set of $\theta(z)$ with $z\in Z(r)$. Note that each element of $\Theta(r)$ is equal to $\dfrac{2p\pi}{q}$ (modulo $2\pi$), where $p$ and $q$ are coprime positive integers such that $p<q$ and $q$ is odd. Furthermore, $\Theta(r)$ is closed under multiplication by $2$. Therefore, the set $\Theta(r)$ can uniquely be partitioned into subsets of the form $$C(\alpha):=\{\alpha,2\alpha,2^2\alpha,2^3\alpha,\ldots\}\,,$$ where $\alpha\in\mathbb{R}/2\pi\mathbb{Z}$. Such a subset of $\Theta(r)$ is called a component.

Here are some examples of components.
If $\alpha=\dfrac{2\pi}{3}$, then $C(\alpha)=\left\{\dfrac{2\pi}{3},\dfrac{4\pi}{3}\right\}$ modulo $2\pi$.
If $\alpha=\dfrac{2\pi}{5}$, then $C(\alpha)=\left\{\dfrac{2\pi}{5},\dfrac{4\pi}{5},\dfrac{6\pi}{5},\dfrac{8\pi}{5}\right\}$ modulo $2\pi$.
If $\alpha=\dfrac{2\pi}{7}$, then $C(\alpha)=\left\{\dfrac{2\pi}{7},\dfrac{4\pi}{7},\dfrac{8\pi}{7}\right\}$ modulo $2\pi$.
If $\alpha=\dfrac{6\pi}{7}$, then $C(\alpha)=\left\{\dfrac{6\pi}{7},\dfrac{10\pi}{7},\dfrac{12\pi}{7}\right\}$ modulo $2\pi$.

For each component $C(\alpha)\subseteq\Theta(r)$, let $$\mu_\alpha(x):=\prod_{\beta\in C(\alpha)}\,\Big(\exp\big(\text{i}\,\beta\big)-x\Big)\,.$$ Observe that $\mu_\alpha$ is a cyclotomic polynomial if and only if $2$ is a generator of the multiplicative group $(\mathbb{Z}/q\mathbb{Z})^\times$, where $\alpha=\dfrac{2p\pi}{q}$ (modulo $2\pi$) for some positive integers $p$ and $q$ with $\gcd(p,q)=1$. Show that there exist positive integers $\nu_\alpha$ for each component $C(\alpha)$ of $r(x)$ such that $$r(x)=\prod_{C(\alpha)\subseteq \Theta(r)}\,\big(\mu_\alpha(x)\big)^{\nu_\alpha}\,.$$ For convenience, we let $\Theta(p):=\Theta(r)$. Therefore, $$p(x)=(-x)^m\,(1-x)^n\,\prod_{C(\alpha)\subseteq\Theta(p)}\,\big(\mu_\alpha(x)\big)^{\nu_\alpha}\,.$$ Any polynomial $p(x)$ in the form above is always a solution to (*).