A query on GCD of polynomials.

44 Views Asked by At

I was figuring out the GCD of $p(x)=x^5 + x^4 + 2x^3 + 2x^2 + 2x + 1$ and $q(x)=x^5 + x^4 + x^3 -x^2 -x -1$ and it turns out to be $g(x)=x^2+x+1$. But when I substitute $x=1$ in the above polynomials then $p(1)=9$ and $q(1)=0$, so, gcd is $9$ but it doesn't match with $g(1)$ which turns out to be $3$. So, I'm left with wondering where I went wrong.

1

There are 1 best solutions below

2
On BEST ANSWER

Your gcd calculation of the polynomials is correct. However, this doesn't mean that you can substitute $x$ by any number and the gcd relation will always hold.

For an easy example, $\gcd(x,x+2)=1$, but when $x=2$, $\gcd(2,4)=2$.