<s>[INST] How to find GCD of those two complex polynomials? I have a polynomial
$$f(x) = i(x^2-1)^3+(x^2+1)^3-8x^3$$
I want to check if this has repeated roots. To do so, I'll find greatest common divisor (euclidean algorithm) of $f(x)$ and its derivative $f'(x)$. 
$$f(x) = i(x^2-1)^3+(x^2+1)^3-8x^3 = i(x^6-3x^4+3x^2-1)+(x^6+3x^4+3x^2+1)-8x^3$$
$$f'(x) = i(6x^5-12x^3+6x)+(6x^5+12x^3+6x)-24x^2$$
I know I should find the GCD as $(x-i)(x-1)$ but this is where I'm stuck. What would the next step be? 
 [/INST] It's best not to split the polynomials up using $i$, but collect terms in powers of $x$.
$$ \eqalign{f_0 = f(x) &=  \left( 1+i \right) {x}^{6}+ \left( 3-3\,i \right) {x}^{4}-8\,{x}^{3}+
 \left( 3+3\,i \right) {x}^{2}+1-i \cr
f_1 = f'(x) &=  \left( 6+6\,i \right) {x}^{5}+ \left( 12-12\,i \right) {x}^{3}-24\,{x
}^{2}+ \left( 6+6\,i \right) x
}
$$
The remainder of $f_0$ on division by $f_1$ is 
$$  f_2 = f_0 - (x/6) f_1 = \left( 1-i \right) {x}^{4}-4\,{x}^{3}+ \left( 2+2\,i \right) {x}^{2}+
1-i
$$
Then take remainder of $f_1$ on division by $f_2$, etc.
</s>