# Finding the GCD of two polynomials.

Hello I'm trying to find the GCD of these two polynomials:

$$X^4-X^3-4X^2-X+5$$ $$X^2+X-2$$

And then I want to express the GCD of these two polynomials in terms of themselves multiplied by other polynomials (Like Bezout's lemma.)

I am struggling to do this though and would like so help. Many thanks.

• Do you know how to apply the euclidean algorithm to polynomials using polynomial long division? – AlexR May 21 '15 at 10:39
• Yes, the main reason I'm stuck is because there is a coefficient that isn't one when you do the long division? And I thought a GCD had to be monic so that's why I'm getting confused. – Sean May 21 '15 at 10:41
• @Sean, I think you should show your work using the Euclidean Algorithm in your question. – Prasun Biswas May 21 '15 at 10:42
• If $P$ is a common divisor, so is $\lambda P$ for $\lambda\in\mathbb R$. You can thus simly scale your result to be monic. Maybe you should show your steps. You may want to use \begin{align*}a^2+b^2 &= c^2 \\ d^2 + e^2 &= f^2\end{align*} for better alignment when doing that: \begin{align*}a^2+b^2 &= c^2 \\ d^2 + e^2 &= f^2\end{align*} – AlexR May 21 '15 at 10:43
• So at one point I got the remainder to be $-5X+5$ so when I do the next division could I just divide by $-X+1$? – Sean May 21 '15 at 10:44

Let $f(x)=x^4-x^3-4x^2-x+5$, $g(x)=x^2+x-2$

For $g(x)$, as $g(1)=0$,

$g(x)=(x-1)(x+2)$

For $f(x)$, observe

$f(1)=1-1-4-1+5=0$, so $(x-1)$ is a factor of $f(x)$, by the Remainder Theorem.

Hence $f(x)=(x-1)(x^3-4x-5)$.

For $h(x)=x^3-4x-5$,

Since $h(2)=8-8-5=-5\neq0$

$x-2$ obviously cannot divide $x^3-4x-5$ and they have no common factor.

So the GCD of $g(x)$ and $f(x)$ is $x-1$

Use the Division algorithm to divide the first by the second and keep going until we get zero remainder. The last we divided by is the gcd. Then we go back step by step. to express gcd as a linear combination.