Let degP(x)=0. Then P(x)=a=0 and from relation (1) we have: a3+3a2=−2a⇔a=−1 or a=−2.
Hence the constant (nonzero) polynomials P(x)=−1 and P(x)=−2, are solutions of the problem.
Let degP(x)=n>0. Then the polynomial P(x) can be written as
P(x)=axn+Q(x), with a=0 and degQ(x)=k≤n−1 or Q(x)=0.
By substitution into relation (1) we get:
(axn+Q(x))3+3(axn+Q(x))2=ax3n+Q(x3)−3Q(−x)−3a⋅(−1)nxn,(2)
for all x∈R. Equating the coefficients of x3n in the two parts we find:
a3=a⇔a=1 or a=−1.
Therefore we distinguish the following cases:
I. a=1. Then relation (2) becomes:
(xn+Q(x))3+3(xn+Q(x))2=x3n+Q(x3)−3Q(−x)−3(−1)nxn⇔A(x)=B(x),(3)
where we have put
A(x)=3x2nQ(x)+3xn(Q(x))2+(Q(x))3+3x2n+6xnQ(x)+3(Q(x))2B(x)=Q(x3)−3Q(−x)−3(−1)nxn.
If Q(x)=0, then: 3x2n=−3⋅(−1)nxn, (impossible).
If degQ(x)=k>0, then, since 0<k<n, we have:
2n+k=degA(x)=degB(x)=max{3k,n}≥3k⇒n≥k, absurd.
Thus, we have degQ(x)=0, that is Q(x)=c=0 and then A(x)=B(x):
3(c+1)x2n+3(c2+2c+(−1)n)xn+c3+3c2+2c=0, for all x∈R⇔c+1=0, c2+2c+(−1)n=0, c3+3c2+2c=0⇔c=−1, n=2m, m∈N∗.
Hence the polynomial: P(x)=x2m−1, x∈R, m∈N∗ is a solution.
II. a=−1. Then relation (2) becomes:
(−xn+Q(x))3+3(−xn+Q(x))2=−x3n+Q(x3)−3Q(−x)+3(−1)nxn⇔A(x)=B(x),
where we have put
A(x)=3x2nQ(x)−3xn(Q(x))2+(Q(x))3+3x2n−6xnQ(x)+3(Q(x))2B(x)=Q(x3)−3Q(−x)+3(−1)nxn.
Working as in case (I), if Q(x)=0, then: 3x2n=3⋅(−1)nxn, (impossible).
If degQ(x)=k>0, then, since 0<k<n, we have:
2n+k=degA(x)=degB(x)=max{3k,n}≥3k⇒n≥k, absurd.
Hence degQ(x)=0, that is Q(x)=c=0 and then from equality A(x)=B(x) we have:
3(c+1)x2n−3(c2+2c+(−1)n)xn+c3+3c2+2c=0, for all x∈Rc+1=0, c2+2c+(−1)n=0, c3+3c2+2c=0⇔c=−1, n=2m, m∈N∗.
Hence we have the solution: P(x)=−x2m−1, x∈R, m∈N.
Finally, all solutions of the problem are the following:
P(x)=−1, P(x)=−2, P(x)=x2m−1, P(x)=−x2m−1, x∈R, m∈N∗.