Denote m as degree of P(x) then by comparing the leading coefficients a of two sides, we get an=a. We consider two cases based on the parity of n.
1. If n is even then a=1. Put P(x)=xm+Q(x) with Q∈R[x] and if Q(x)≡0, we obtain P(x)=xm as a solution. Otherwise, suppose that Q(x)=0 and degQ(x)=k<m. So
(xm+Q(x))(x2m+Q(x2))⋯(xmn+Q(xn))−x2mn(n+1)=Q(x2n(n+1)).
The degree of LHS is 2mn(n+1)−(m−k), while the degree of RHS is 2kn(n+1). Note that
2mn(n+1)−(m−k)−2kn(n+1)=2(m−k)(n+2)(n−1)>0
which implies that the degree of both sides cannot be equal. Thus Q(x)≡0.
2. If n is odd then a=±1 and the case a=1 can be solved similarly as above. For the case a=−1, put P(x)=−(xm+Q(x)) then process similarly, we get P(x)=−xm as another solution.
Hence, P(x)=xm for some m∈Z+ when n is even and P(x)=±xm when n is odd. □