What am I doing wrong in finding the $\gcd(x^3-2x^2-x+2, x^3-4x^2+3x)$? Could someone tell me what I am doing wrong in the process of finding the gcd with Euclid's Algorithm? The gcd is supposedly $(x-1)$ but I only get $-2(x-1)$.
$f(x) = x^3-2x^2-x+2$
$g(x) = x^3-4x^2+3x$
$f(x) = 1*g(x)+2x^2-4x+2$
$g(x) = 1/2x*r_1 -(2x^2-2x)$
$r_1 = (-1)*r_2 -2x+2$
$r_2 = x*(r_3)$
$\gcd(f(x),g(x)) = -(2x+2) \implies -2(x-1)$
Thanks in advance!

$$  \left(   x^{3}  - 2 x^{2}  -  x  + 2 \right)  $$ 
$$  \left(   x^{3}  - 4 x^{2}  + 3 x  \right)  $$ 
$$  \left(   x^{3}  - 2 x^{2}  -  x  + 2 \right)  =  \left(   x^{3}  - 4 x^{2}  + 3 x  \right)  \cdot \color{magenta}{  \left( 1  \right) } +  \left(  2 x^{2}  - 4 x  + 2 \right)  $$ 
 $$  \left(   x^{3}  - 4 x^{2}  + 3 x  \right)  =  \left(  2 x^{2}  - 4 x  + 2 \right)  \cdot \color{magenta}{  \left(   \frac{  x  - 2 }{ 2 }  \right) } +  \left(   - 2 x  + 2 \right)  $$ 
 $$  \left(  2 x^{2}  - 4 x  + 2 \right)  =  \left(   - 2 x  + 2 \right)  \cdot \color{magenta}{  \left(   -  x  + 1 \right) } +  \left( 0 \right)  $$ 
 $$ \frac{ 0}{1} $$ 
 $$ \frac{ 1}{0} $$ 
 $$ \color{magenta}{  \left( 1  \right) }  \Longrightarrow  \Longrightarrow  \frac{  \left( 1  \right) }{ \left( 1  \right) } $$ 
 $$ \color{magenta}{  \left(   \frac{  x  - 2 }{ 2 }  \right) }  \Longrightarrow  \Longrightarrow  \frac{  \left(   \frac{  x  }{ 2 }  \right) }{ \left(   \frac{  x  - 2 }{ 2 }  \right) } $$ 
 $$ \color{magenta}{  \left(   -  x  + 1 \right) }  \Longrightarrow  \Longrightarrow  \frac{  \left(   \frac{  -  x^{2}  +  x  + 2 }{ 2 }  \right) }{ \left(   \frac{  -  x^{2}  + 3 x  }{ 2 }  \right) } $$ 
 $$  \left(   x^{2}  -  x  - 2 \right)  \left(   \frac{  x  - 2 }{ 4 }  \right)  -  \left(   x^{2}  - 3 x  \right)  \left(   \frac{  x  }{ 4 }  \right)  =  \left( 1  \right)  $$ 
 $$  \left(   x^{3}  - 2 x^{2}  -  x  + 2 \right)  =  \left(   x^{2}  -  x  - 2 \right)  \cdot \color{magenta}{  \left(   x  - 1 \right) } +  \left( 0 \right)  $$ 
 $$  \left(   x^{3}  - 4 x^{2}  + 3 x  \right)  =  \left(   x^{2}  - 3 x  \right)  \cdot \color{magenta}{  \left(   x  - 1 \right) } +  \left( 0 \right)  $$ 
 $$  \mbox{GCD} =   \color{magenta}{  \left(   x  - 1 \right) }   $$ 
 $$  \left(   x^{3}  - 2 x^{2}  -  x  + 2 \right)  \left(   \frac{  x  - 2 }{ 4 }  \right)  -  \left(   x^{3}  - 4 x^{2}  + 3 x  \right)  \left(   \frac{  x  }{ 4 }  \right)  =  \left(   x  - 1 \right)  $$ 
........................
