How can I find the the multiplicative inverse of $x^4 −3x^3 +2x^2 +4x−2$ in $\mathbb{Z}_5[x]/g(x)$, where $g(x) = x^2-2x+2$.
My idea is to use the extended Euclidean algorithm of the polynomials, but the greatest common divisor seemed to be $x+1$ which is not $1$, so are there no solutions or it is the mistake of my gcd?
$x^4 - 3x^3 + 2x^2 + 4x + 2 = (x^2-2x + 2)(x^2 - x - 2) +2x + 6$
$x^4 - 3x^3 + 2x^2 + 4x + 2 \equiv 2x + 1$ in the quotient ring.
Now we must find $a,b$ such that $(ax+b)(2x+1) \equiv 1$ in the ring.
$2ax^2 + (a+2b)x + b = (x^2-2x + 2)(2a) + (5a+2b)x + (-4a + b) \equiv 2bx + (a+b) = 1$
$x$ is the multiplicative inverse.