[Math] finding the greatest common divisor of two polynomial, I’m stuck

euclidean-algorithmgcd-and-lcmpolynomials

I'm trying to find the greates common divisor of two polynomials. The polynomials are:
\begin{align*}
p_1 &= x^3+3x+1\\
p_2 &= x^4+1
\end{align*}
Matlab is telling me that the GCD is 1, and that's also what I was expected.

However when I try to do It by hand it dosn't equal to 1, so what am I doing wrong?(I'm using Long division and writing it as Euclidian algorithm).

\begin{align*}
x^4+1 &= (x^3+3x+1) \cdot x -(3x^2-x+1)\\
x^3+3x+1 &= (-3x^2-x+1) \cdot (\frac{-x}{3}+\frac{1}{9}) + (\frac{31x}{9}+\frac{8}{9})\\
-3x^2-x+1 &= (\frac{31x}{9}+\frac{8}{9})\cdot (\frac{-27x}{31} – \frac{63}{961})+ \frac{1017}{961}\\
\frac{31x}{9}+\frac{8}{9}&=\frac{1017}{961}\cdot (\frac{29791x}{9153}+\frac{7688}{9153})+\frac{8}{9}\\
\frac{1017}{961} &= \frac{8}{9} \cdot \frac{9153}{7688} + 0
\end{align*}

so the GCD should be $= \frac{8}{9}$??

Best Answer

$8/9$ and $1$ are the "same thing" because there exists a unit in the ring $\mathbb R [x]$ that send one to the other (notice that $\frac{9}{8}$ is a unit).

You may be confused because the units in the ring of integers are only $1$ and $-1$.

The convention is to let $\gcd(P,Q)$ be monic when working with polynomials.

Related Question