<s>[INST] Find all the real roots of $P(Q(x))=0$ Let $$P(x)=x^2+\frac{x}{2}+b$$ and $$Q(x)=x^2+cx+d$$ be two polynomials with real coefficients such that $\displaystyle P(x)\cdot Q(x)=Q(P(x))$ for all real $x$. Find all the real roots of $P(Q(x))=0$.

I found out that
\begin{align}
x^4+x^3c+x^2d+\frac{x^3}{2}+\frac{x^2c}{2}+\frac{xd}{2}+bx^2+bcx+bd&=\\x^4+x^3+2bx^2+\frac{x^2}{4}+bx+b^2+cx^2+\frac{cx}{2}+cb+d
\end{align}
After this I am stuck. I don't see any ideas now.
Any help is greatly appreicated.
 [/INST] So the equation you've found gives
$$x^4+x^3(c+1/2)+x^2(d+c/2+b)+x(d/2+bc)+bd=x^4+x^3+(2b+1/4+c)x^2+(b+c/2)x+(b^2+cb+d)$$
Comparing coefficients, we get

*

*$c+1/2=1\implies c=1/2$

*$d+c/2+b=2b+1/4+c\implies d+1/4+b=2b+1/4+1/2\implies d=b+1/2$

*$d/2+bc=b+c/2\implies d/2+b/2=b+1/4\implies d=b+1/2$

*$bd=b^2+bc+d\implies b(b+1/2)=b^2+b/2+d\implies d=0\implies b=-1/2$
So $P(x)=x^2+x/2+b=\frac{1}{2}(2x^2+x-1)$ and $Q(x)=x^2+cx+d=x^2+x/2$.

Now $P$ has two roots, $x=-1, 1/2$.
So roots of $P(Q(x))=0$ are the solutions to

*

*$Q(x)=-1\implies x^2+x/2=-1\implies x^2+x/2+1=0$ this has no real roots.

*$Q(x)=1/2\implies x^2+x/2=1/2\implies 2x^2+x-1=0\implies x=-1, 1/2$.

</s>