I'm trying to find the multiplicative inverse of the element $x^2 + 1$ in the ring $\Bbb{F}_3[x]/(x^3 + 2x + 2)$. I tried to use the Euclidean Algorithm, but it isn't really getting me anywhere, I never reach the point where I have a $1$ on the right hand side, which makes it impossible for me to reverse the process.
For example, I've tried:
$$x^3 + 2x + 2 = x \dot (x^2 + 1) + (x + 2) $$ $$x^2 + 1 = x \dot (x + 2) +(-2x+1) $$ $$x+2 = -1 \dot (-2x+1) +(-x+3) $$ $$-2x+1 = 1 \dot (-x+3) +(-x-2) $$ $$-x+3 = 1 \dot (-x-2) + 5 $$ $$(-x-2) = 1 \dot 5 +(-x-7) $$ ...etc. As you can see, it's not really working for me.
Any help is appreciated!
In your second line, note that $-2x+1=x+1$, since we are doing arithmetic in $\mathbb{Z}_3$. Now can you finish?
Added: As in your first line, we have $$x^3+2x+2=x(x^2+1)+x+2.\tag{1}$$ The second line, with the arithmetic done in the field, is then $$x^2+1=x(x+2)+x+1.\tag{2}$$ Finally, $$x+2=(1)(x+1)+1.\tag{3}$$ Now work backwards. From (3) and (2) we have $$1=(x+2)-(x+1)=(x+2)-[(x^2+1)-x(x+2)]=(1+x)(x+2)-(x^2+1).$$ Finally, from (1) we have $$1=(1+x)[x^3+2x+2-x(x^2+1)]-(x^2+1)=(1+x)(x^3+2x+2)+[-x-x^2-1](1+x^2).$$ So the inverse of $x^2+1$ can be written as $-x^2-x-1$, or equivalently as $2x^2+2x+2$.