I'm trying to find the multiplicative inverse of $\overline{x+1}$ over the field $\mathbb{F}_3[x]/(x^3 + 2x + 1)$. I know I need to use Euclid's algorithm to do so, but I keep running into some difficulties.
I let $f(x) = x^3 + 2x + 1$ and $g(x) = x+1$. Then I should be able to compute
$$f(x) = q_1(x)g(x) + r_1(x)$$
$$g(x) = q_2(x)r_1(x) + r_2(x)$$
$$\vdots$$
$$ r_{m-1}(x) = q_{m+2}(x)r_m(x)$$ and then back substitute through the algorithm to solve for $a(x), b(x)$ in
$$ a(x)g(x) + b(x)f(x) = 1.$$ My problem is likely elementary, but it has me confused: I cannot find $q_1$, $q_2$ to make what should probably be a rather trivial iteration of the algorithm work at all. If I was solving for, say, the multiplicative inverse of $\overline{x ^2}$, I could let $f(x) = (x)(x^2) + (2x+1)$ with $g(x) = x^2 = (2x+1)(2x+2)+1$. The division follows nicely from there. However, I can't find out where I'm going wrong for $\overline{x+1}$... What am I missing?