Getting the multiplicative inverse of a polynomial I have a polynomial $m(x)=  x^2 + x + 2$ that's irreducible over $F=\mathbb{Z}/3\mathbb{Z}$. I need to calculate the multiplicative inverse of the polynomial $2x+1$ in $F/(m(x))$. 
I'd normally use division with two polynomials like this, but it doesn't work here. So how can I get the inverse?

Working in $(\mathbb{Z}/3\mathbb{Z})[[x]]/\langle x^2 + x + 1 \rangle$, 
one (awful) way to do it is to notice that $2x + 1 = 1 - x$, so
$$(2x+1)^{-1} = \frac{1}{1-x} = 1 + x + x^2 + x^3 + \dotsb. $$
But $1 + x + x^2 = -1 = 2$ 
and, since $x^2 = -x - 2 = 1-x$,
$$x^3 + \dotsb = \frac{x^3}{1-x} = \frac{x^3}{x^2} = x,$$
giving $(2x+1)^{-1} = 2 + x$.
