f(x)= x^4+ 3x^3+ 2x + 4
and g(x) = x^3+ 4x^2+ x + 3 in Z5[x]
For these two polynomials Mathematica gives me as a result (x+1).
PolynomialGCD[x^4+ 3x^3 +2x + 4, x^3+ 4x^2+ x + 3, Modulus -> 5 ]
Now "pencil-and-paper" yields (2x +2). I did all checks. It is above my head what is going on here. I factor 2 and can write it like 2 * x^0 (x+1). But what is the idea behind this?
And what is really nagging on me: How does this work out if I am calculating the modular inverse of a polynomial???