Let a polynomial, $p(x)$, of degree $n$ is given. Our aim is to find another polynomial, $q(x)$, whose roots are the cubes of the roots of $p(x)$.
Our algorithm go like this:
Step 1 Replace $x$ by $x^\frac{1}{3}$.
Step 2 Collect all the terms involving $x^\frac{1}{3}$ and $x^\frac{2}{3}$ on one side.
Step 3 Cube both the sides and simplify.
Although I get the correct answer by following this algorithm but I can't get my head around the reasoning behind its working. So, can you kindly help me to figure it out?
$\fbox{EDIT 1:}$
Proof that the final equation of $q(x)$ so obtained will be a polynomial:
We originally had $$p(x)=0$$
Step 1 Replace $x$ by $x^\frac{1}{3}$.
After replacing $x$ by $x^\frac{1}{3}$ we get an equation like $$p_{1}(x)+x^\frac{2}{3}p_{2}(x)+x^\frac{1}{3}p_{3}(x)=0$$
Here, $p_{1}(x)$, $p_{2}(x)$ and $p_{3}(x)$ are polynomials in $x$.
Step 2 Collect all the terms involving $x^\frac{1}{3}$ and $x^\frac{2}{3}$ on one side.
Now we have $$x^\frac{2}{3}p_{2}(x)+x^\frac{1}{3}p_{3}(x)=-p_{1}(x) \qquad(1)$$
Step 3 Cube both the sides and simplify.
Cubing both the sides of $(1)$ we get $$x^{2}p^{3}_{2}(x)+xp^{3}_{3}(x)+3xp_{2}(x)p_{3}(x)[x^\frac{2}{3}p_{2}(x)+x^\frac{1}{3}p_{3}(x)]=-p^{3}_{1}(x)$$
$$p^{3}_{1}(x)+x^{2}p^{3}_{2}(x)+xp^{3}_{3}(x)+3xp_{2}(x)p_{3}(x)[x^\frac{2}{3}p_{2}(x)+x^\frac{1}{3}p_{3}(x)]=0 \qquad(2)$$
Now, from $(1)$ and $(2)$ we have $$p^{3}_{1}(x)+x^{2}p^{3}_{2}(x)+xp^{3}_{3}(x)+3xp_{2}(x)p_{3}(x)[-p_{1}(x)]=0$$
Therefore, $q(x)=p^{3}_{1}(x)+x^{2}p^{3}_{2}(x)+xp^{3}_{3}(x)-3xp_{1}(x)p_{2}(x)p_{3}(x)$
Clearly, $q(x)$ is a polynomial.