I'm getting stuck on this problem.

Find the GCD d(x) of the following polynomials f(x), g(x) in F[x], and express d(x)=s(x)f(x)+t(x)g(x) for appropriate s(x), t(x) en F[x]

In this case, f(x)= x^2 + 2x + 2 and g(x)= x^2 + 1 for both F= the rationals and F= the complex number set.

I started the problem by performing long division to see that f(x) / g(x) =1 with a remainder of 2x+1. I then realized that GCD of f(x), g(x) = GCD of g(x), 2x+1. But after division, I only got this result before getting stuck:

x^2 + 1 = (2x+1)((1/2)x - (1/4)) + (3/4)

Is this right so far, and how to do I finish it up? And how do I work this problem differently for the complexes?

Thanks in advance!