2

Excuse me for the confusing title. I was asked to find $gcd(x^2+3x+2,x^2+x)$

What i did is i factorized both polynomials $x^2+x=(x+1)x$

$x^2+3x+2=(x+1)(x+2)$

So i expected the gcd to be $x+1$

But using the euclidean algorithm i found out the gcd to be $2x+2$. Why is factorizing wrong? Is it because $K[X]$ is not factorial ? Would the euclidean algorithm also work if the polynomials are in $\Bbb Z[X]$ ???

Bill Dubuque
  • 272,048
asddf
  • 1,733
  • 2
    $\langle x^2 + 3x + 2, x^2 + x \rangle$ is not a principal ideal in $\mathbb{Z}[x]$ - despite the fact that $\mathbb{Z}[x]$ is in fact a UFD. On the other hand, if you take the gcd in $\mathbb{Q}[x]$ which is a PID then your two answers differ by a unit. – Daniel Schepler Oct 17 '18 at 18:45
  • As Daniel said, $2x+2=2(x+1)$ and $x+1$ are not different as factorizations over $\mathbb Q[x]$. Nothing went wrong on that front. $K[x]$ is always factorial when $K$ is a field (or even if just $K$ is factorial.) – rschwieb Oct 17 '18 at 18:46
  • So factorizing over $\Bbb Q [X] $ doesnt make sense ? – asddf Oct 17 '18 at 18:48
  • @asddf No, it makes perfect sense. You'll have to elaborate on your line of thought for me to follow, because I don't know what would prompt you to ask such a thing. – rschwieb Oct 17 '18 at 18:49
  • Ok i think i follow now, thank you – asddf Oct 17 '18 at 18:51
  • Just another question? How could i have known after factorizing that the gcd isnt x+1 but 2(x+1) is it somehow visible ? – asddf Oct 17 '18 at 18:54
  • But the gcd is indeed $x+1$, up to a unit in $\Bbb{Q}$. And $2$ is a unit! So no confusion anymore. – Dietrich Burde Oct 17 '18 at 19:00

2 Answers2

3

There is no unique gcd of two polynomials $f,g\in \Bbb{Q}[X]$. It is only unique up to a unit in $\Bbb{Q}$. So any of the polynomials $c(X+1)$ with $c\neq 0$ is a gcd of $X^2+3X+2$ and $X^2+X$.

References: Uniqueness of greatest common divisor

gcd(a,b) is unique up to units in a unique factorization domain

Greatest common divisor of two polynomials in $\Bbb Q[X]$

Dietrich Burde
  • 130,978
0

Remark that $x^2+3x+2-(x^2+x)=2x+2$, this implies that $(x+1)$ is contained in $(x^2+3x+2,x^2+x)$, the fact that $(x+1)$ contains $(x^2+3x+2,x^2+2)$ results from the factorizations that you have provided. $gcd(P(x),Q(x))=(P(x),Q(x))$.