What am I doing wrong in finding the $\gcd(x^3-2x^2-x+2, x^3-4x^2+3x)$?

283 Views Asked by At

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!

2

There are 2 best solutions below

1
On BEST ANSWER

Your result and the expected result differ only by a constant factor. The gcd is only determined up to a unit, which in case of polynomials over fields means up to constant (non-zero) multiple. One conventionally uses the polynomial with leading coefficient $1$. (Cf. in the case of integers, where the gcd is determined up to sign (the units of $\Bbb Z$ are $\pm1$) and one conventionally takes the positive solution (which in that case is well in line with the notion of "greatest").

The situation might be different if you wanted to compute the gcd explicitly in $\Bbb Z[x]$ (where again the units are ony $\pm1$) instead of $\Bbb Q[x]$. But then you'd not be allowed to use a factor of $\frac12$ as you do in your calculation.

0
On

$$ \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) $$ ........................