Supposed we have something like . How can we find the minimal polynomial of B?

I know if we had say A=J_6(0) and B=A^2. Then the min poly of B would be m(x)=x^3. Since B^3=(A^2)^3.

My concern with the first one is that we're not going to get a nice integer value. So would it be correct to say B^3=(A^6)^3*A^2... I'm a bit confused and could use some direction.