Question: Show that $x^3-2x-2$ is irreducible over $\mathbb{Q}$. Let $t$ be a root of this polynomial, then compute $$\frac{1+t}{1+t+t^2}$$ in $\mathbb{Q}(t)$.

My attempt: It is easy to show that given polynomial is irreducible over $\mathbb{Q}$ by Eisenstein's Criterion with $p=2$. Now for the second part....by applying Euclidean Algorithm we get that $x^3-2x-2=(1+x+x^2)(x-1)-2x-1$. By putting $x=t$ we get $1+t+t^2=(2t+1)/(t-1)$. Since $t$ is a root then $t^3-2t-2=0$ implies $(1+t)=t^3/2$. Consequently, our value of $(1+t)/(1+t+t^2)$ is $t^3(2t+1)/2(t-1)$ which is not correct according to the answer. The answer is given as a quadratic polynomial in $t$. Please help me to solve this in good way.

Answer: 
You need to use the [extended Euclidean Algorithm](http://www.wolframalpha.com/input/?i=PolynomialExtendedGCD%5Bx%5E3-2x-2,1%2Bx%2Bx%5E2,x%5D) to get
$$
1 = \frac13(2 x + 1)(x^3-2x-2) + \frac13(-2 x^2 + x + 5)(1+x+x^2)
$$
which implies
$$
\frac{1+t}{1+t+t^2} = \frac13(1+t)(-2 t^2 + t + 5)
$$
Now expand the RHS and use $t^3=2t+2$ to reduce it to a quadratic.
You dont need Euclidean algorithm here. Because $t$ is a root of the given polynomial you know already that $t^3-2t-2=0$ which gives you $t^3=2t+2$. And so this gives you a way to reduce all polynomials of degree more than two to lower degree. Now if you write 
$$
\frac{1+t}{1+t+t^2}=a+bt+ct^2
$$
And multiply this out and compare coefficients in both sides of the equations you get a linear system of three equations that will give you a correct answer i.e. $a=1/3$, $b=2/3$ and $c=-2/3$.