<s>[INST] Euclidean Algorithm for polynomials I know how to use the extended euclidean algorithm for finding the GCD of integers but not polynomials. I can't really find any good explanations of it online. The question here is to find the GCD of 
m(x) = $\ x^3+6x+7 $ and n(x) = $\ x^2+3x+2 $. 
I try to use it the same way as for integers but don't really get anywhere and just get huge lines without ever reducing it and getting closer to finding the GCD.
 [/INST] For $m(x) =  ^3 + 6 + 7$ and $n(x) =  ^2 + 3 + 2$,
Set
$m(x) = ^3 + 6 + 7 = p(x)n(x) + r_1(x) = p(x)(^2 + 3 + 2) + r_1(x)$
Where $r_1(x)$ is your remainder term. You want to find some p(x) that multiplies with n(x) to give you the first term of m(x). You also want $deg r_1(x) < deg n(x)$.
In this case, p(x) should be linear to get the $x^3$ term. So set $p(x) = ax+b$.
So now you have,
$m(x)= p(x)n(x) + r_1(x) = (ax+b)(^2 + 3 + 2) + r_1(x)$
Mulitply out: 
$m(x) = (ax+b)(^2 + 3 + 2) + r_1(x) = ax^3 + (3a+b)x^2 + (2a+3b)x + 2b + r_1(x)$
Since the coefficient of $x^3$ in m(x) is 1, set $a = 1$.
Similarly, set $3a+b=0$ since there's no $x^2$ term in m(x). Solve for b, $b = -3$.
Plug $a = 1$ and $b = -3$ into the rest of the polynomial:
$m(x) = x^3 -7x -6 + r_1(x)$
Then rearrange to find $r_1(x)$: 
$r_1(x) = m(x) - p(x)n(x) = 13x + 13$
Now repeat the process! 
This time set:
$n(x) = p_2(x)r_1(x) + r_2(x)$
Follow the same process to find $p_2(x)$ and $r_2(x)$, keep repeating this, eg once you know $r_2(x)$ the next equation would look like $r_1(x) = p_3(x)r_2(x) + r_3(x)$ etc, until you get a remainder term that equals zero. Then the previous remainder term is your gcd.
</s>