# Find all polynomials with real coefficients $P(x),Q(x)$ such that for every real number $x$ we have: $P(Q(x))=P(x)^{2017}$

Find all polynomials with real coefficients $P(x),Q(x)$ such that for every real number $x$ we have: $$P(Q(x))=P(x)^{2017}$$

This problem is really hard to me!! I have no idea for the solution!
It has been given in summer camp for Iranian MO.

• Clearly $Q(x)$ must have degree $2017$ for otherwise $P(Q(x))$ and $P(x)^{2017}$ have different degrees, and therefore there are only finitely many solutions to the equation. You also get information about the leading coefficients. But, this doesn't say much. – Jyrki Lahtonen Aug 14 '17 at 6:36
• @JyrkiLahtonen There are infinitely many; $P(x)=x^n,\,Q(x)=x^{2017}$ is a solution for all $n$. – stewbasic Aug 14 '17 at 6:42
• Yes, @stewbasic. I spotted those solutions right away. $Q(x)=-x^{2017}$ also works if $n$ is even. But are they all? – Jyrki Lahtonen Aug 14 '17 at 6:44
• @JyrkiLahtonen - Didn't you mean P(x)=x? – steven gregory Aug 14 '17 at 6:52
• There are solutions $P(x)=ax^n, Q(x)=bx^{2017}$ with $a^{2016}=b^n$. In particular there is the solution $P=Q=0$. – Mark Bennet Aug 14 '17 at 6:57

Contrary to my initial guess, we do not need that $2017$ is prime.

Theorem. Let $N>1$ and $P,Q\in\Bbb C[X]$ such that $$\tag0 P(Q(x))=P(x)^{N}\qquad\text{for infinitely many }x\in\Bbb C.$$ Then either $P$ is constant or there are $n\in\Bbb N$, $a,b,\beta\in\Bbb C$ with $a^{N-1}=b^n$ and $$\tag1 P(X)=a(X-\beta)^n,\quad Q(X)=b(X-\beta)^N+\beta.$$

Proof. First of all, note that the polynomial equation $(0)$ will also hold for all $x\in\Bbb C$. If $f$ is a polynomial and $z\in\Bbb C$, let $v_f(z)$ denote the order of $z$ as root of $f$. So $v_f(z)=0$ for almost all $z$ and $\sum_{z\in\Bbb C}v_f(z)=\deg f$.

Let $n=\deg P$, $m=\deg Q$. As we are interested only in non-constant $P$, we can assume $n>0$. The degree of $P\circ Q$ is $nm$, that of $P^{N}$ is $Nn$. We conclude that $m=N$.

From $(0)$ we see that for $\alpha\in\Bbb C$ and $\beta:=Q(\alpha)$, $$\tag2 N\cdot {v_P(\alpha)} = v_P(Q(\alpha))\cdot v_{Q-\beta}(\alpha).$$ For $\alpha$ that maximizes $v_P$ (in particular, $v_P(\alpha)>0$), $(2)$ implies $v_{Q-\beta}\ge N$. Thus $Q-\beta$ is a multiple of $(X-\alpha)^N$, i.e., $$\tag3Q(X)=b(X-\alpha)^N+\beta$$ with $\alpha,\beta,b\in\Bbb C$, $b\ne0$. Then $\alpha$ is the only root of the derivative $Q'(X)=Nb(X-\alpha)^{N-1}$, hence $Q(X)-w$ with $w\ne \beta$ has $N$ distinct, simple roots and at most one of these equals $\beta$. Accordingly, let $w^*$ be a root of $Q(X)-w$ with $w^*\ne\beta$. Adapting $(2)$, we find $Nv_P(w^*)=v_P(w)$. By infinite descent, we find that $v_P(w)=0$ for all $w\ne\beta$. In other words, $$\tag4P(X)=a(X-\beta)^n$$ for some $a\ne 0$.

Then $\beta$ is the only root of $P(X)^{N}$, hence the only root of $Q(X)-\beta$. Therefore $\beta=\alpha$. By a quick comparison of leading coefficients, we arrive at $(1)$. $\square$

Remark: If we know that $P,Q$ have real coefficients, then of course $a,b,\beta$ are real.