# Extended Euclidean algorithm for polynomials

I have to find the gcd of $x^3 + 1$ and $x^2 + 1$ in $Q[x]$. I found this to be $1$. However I also have to write the gcd as a combination of these polynomials, but I'm stuck at this. I think I have to use the extend eucledian algorithm for this.