<s>[INST] Let $f(x)=x^2+2x$ and $g(x)=x^3$, finding the roots of $f\circ g(x)=g\circ f(x)$ Let $f(x)=x^2+2x$ and $g(x)=x^3$, how many different roots does $f\circ g(x)=g\circ f(x)$ have?
I solved it and found $x=-1$ but it says it has two different roots, could someone clarify?
 [/INST] Other than the nice answer from Alex, you can also do it concretely:
$$f\circ g(x)=f(x^3)=x^6+2x^3=x^3(x^3+2)$$ and 
$$g\circ f(x)=g(x^2+2x)=(x^2+2x)^3=x^3(x+2)^3.$$
 Therefore, $f\circ g(x)=g\circ f(x)$ can be written as 
$x^3(x^3+2)-x^3(x+2)^3=0$, or equivalently, 
$$x^3\Big[(x+2)^3-(x^3+2)\Big]=x^3\Big[(x^3+6x^2+12x+8)-(x^3+2)\Big]$$
$$=x^3(6x^2+12x+6)=6x^3(x+1)^2=0,$$
which gives $x=0$ or $x=-1$.
</s>