Expressing polynomial as linear combinaion I found these questions in Adams Introduction to Groebner bases
Let $f=x^6-1$ and $g=x^4+2x^3+2x^2-2x-3$. Let  $I=\langle f,g\rangle$. Calculate the polynomial that generates $I$ alone. After a couple of polynomial divisions I came to the answer $h=x^2-1$. 
Is it correct? 
Furthermore, is $x^5+x^3+x^2-7\in I$? I found that it is not, is that result correct? 
Furthermore show that $p:=x^4+2x^2-3\in I$. Again reduction by $h$ shows that it is. But then it goes like: write $p$ as a linear combination of $f$ and $g$. Is this done by the "usual backward Euclidean algorithm"? I mean expressing the remainders and "going backwards"? Is there another method?
Thanks and sorry for the lack of fancy characters, I am in Indonesia and have a hard time with the keyboard.
 A: According to WolframAlpha the gcd between $f$ and $g$ is indeed $x^2 - 1 = (x+1)(x-1)$. The easiest way to see this by hand is to use the Euclidean algorithm. Namely, by polynomial long division we have
$$
\begin{gather}
x^6-1 = (x^2-2 x+2) (\color{green}{x^4+2x^3+2x^2-2x-3}) + \color{red}{2 x^3-5 x^2-2 x+5} \\
\color{green}{x^4+2x^3+2x^2-2x-3} = \left(\frac{x}{2}+\frac{9}{4}\right) (\color{red}{2 x^3-5 x^2-2 x+5}) + \frac{57}{4} x^2 - \frac{57}{4}
\end{gather}
$$
Furthermore, substituting one equation into the other and multiplying by $\frac{4}{57}$ we get
$$
\begin{align}
x^2-1 &= \frac{1}{57} (2 x^3+5 x^2-14 x+22) (x^4+2x^3+2x^2-2x-3) \\
&-\,\frac{1}{57} (2 x+9) (x^6-1) \label{eq:bezout} \tag{1}
\end{align}
$$
which will be useful later.
You can easily see that $x^5 + x^3 + x^2 - 7 \notin I$ because its degree isn't even, but every polynomial in $I = \langle x^2-1 \rangle$ has even degree.
Now, note that $x^4+2x^2−3$ is a quadratic polynomial in $x^2$ and by the usual "sum and product" rule you can see that it factors as $(x^2+3)(x^2-1)$, hence $x^4+2x^2−3 \in I$. Finally, multiplying \eqref{eq:bezout} by $x^2+3$ it immediately follows that
$$
\begin{align}
x^4+2x^2−3 &= \frac{1}{57} (2 x^5+5 x^4-8 x^3+37 x^2-42 x+66) (x^4+2x^3+2x^2-2x-3) \\
&-\,\frac{1}{57} (2 x^3+9 x^2+6 x+27) (x^6-1)
\end{align}
$$
