polynomials [another one]

You have 2 polynomials

$\displaystyle p(x) = x^4 + 1$

$\displaystyle q(x) = x^3 - 1$

$\displaystyle d(x) $ is their greatest common divisor.

a) Find $\displaystyle d(x)$

b) Find such $\displaystyle f(x) $ and $\displaystyle g(x)$ so that the following is true:

$\displaystyle p(x)f(x) + q(x)g(x) = d(x) $

For a) i tried with Euclid's algorithm but it didn't give me any good results (or maybe i did it wrong,, is it done differently than with numbers?)

no clue for b).

can anyone help?