Is there a good way to solve for the inverse of $(u^2-u+4)$? I'm having trouble calculating the inverse of a polynomial. Consider the polynomial $f(x)=x^3+3x-2$, which is irreducible over $\mathbb{Q}$, as it has no rational roots. So $\mathbb{Q}[x]/(f(x))\simeq \mathbb{Q}[u]$ is a field. 
How would I calculate $(u^2-u+4)^{-1}$ as a polynomial? Calling this $p(u)$, I tried solving for it by writing
$$
p(x)(x^2-x+4)=q(x)f(x)+1
$$
but I don't know what $q(x)$ is. How can I write down $(u^2-u+4)^{-1}$ explicitly? Thanks.

Let's calculate the $\gcd$ of the two polynomials $x^3+3x-2$ and $x^2-x+4$ in $\mathbb{Q}[x]$. Using the Euclidean algorithm,
$$x^3+3x-2=x(x^2-x+4)+(x^2-x-2)$$
$$x^2-x+4=(x^2-x-2)+6$$
Because $2$ is a unit in $\mathbb{Q}[x]$, we see that the polynomials are relatively prime. Now, building back up, we see that
$$6=(x^2-x+4)-(x^2-x-2)$$
$$6=(x^2-x+4)-[(x^3+3x-2)-x(x^2-x+4)]$$
$$6=(-1)(x^3+3x-2)+(1+x)(x^2-x+4)$$
$$1=\left(-\tfrac{1}{6}\right)(x^3+3x-2)+\left(\tfrac{1+x}{6}\right)(x^2-x+4)$$
Plugging in $u$, which is a root of $x^3+3x-2$, we see that
$$1=\left(\tfrac{1+u}{6}\right)(u^2-u+4)$$
so that $\tfrac{1+u}{6}$ is the multiplicative inverse of $u^2-u+4$ in $\mathbb{Q}(u)$.
