<s>[INST] Euclidean Algorithm for Polynomials in $\mathbb F_7$ 
I have two polynomials $x^4+5x+1$ and $x^2-1$ and I'm trying to find their GCD over $\mathbb F_7$.

My attempt is:
$x^4+5x+1$ = $(x^2+1)(x^2-1)+5x+2$
$x^2-1 =\ ?$
I get lost on the second step... 
 [/INST] $x^4+5x+1=(x^2+1)(x^2-1)+5x-5=(x-1)(x^3+x^2+x+6)$
$x^2-1=(x-1)(x+1)$
$x^3+x^2+x+6$ has no $-1$ as a root
$\gcd(x^4+5x+1,x^2-1)=x-1$
Using the Euclidean algorithm: $x^2-1=(5x+2)(3x+1)+3(x-1)$
</s>