I have two polynomials $f,g\in\mathbb{Q}[x]$, $f=x^3-x^2-1,\ g=x^2-3x+1$ and I have to find their GCD using the Extended Euclidean algorithm. I've done the following steps:
$$ \begin{aligned} f= gq_0+r_0 & \qquad q_0 = x+2 & r_0 = 5x-3 &\qquad\cfrac{x^3-x^2-1}{x^2-3x+1} = x+2+\cfrac{5x-3}{x^2-3x+1}\\ g=r_0q_1 + r_1 & \qquad q_1 = \cfrac{x}{5}-\cfrac{12}{25} & r_1 = -\cfrac{11}{25} &\qquad \cfrac{x^2-3x+1}{5x-3} = \cfrac{x}{5}-\cfrac{12}{25}+\cfrac{-11/25}{5x-3}\\ \end{aligned} $$
And, If I understood everything correctly GCD of $f,g$ is $-\cfrac{11}{25}$, because $\exists q_2\in\mathbb{Q}[x]\colon r_0=r_1q_2+0$ and therefore $-\cfrac{11}{25}$ is equal to GCD of $f,g$ and this is indeed true, because I can divide any of them on this number without any problems. But, according to WolframAlphra and SageMath their GCD is equal to $1$ and I'm much more likely to believe that I've made a mistake somewhere, But I can't see any issues with my computations either (I've checked all polynomial divisions etc using the same tools, so I think that it is not a computational error)
And another question that follows from previous one: if GCD of two polynomials of nonzero degree is a polynomial of a zero degree (in other words an number) does that mean that they are coprime?
NOTE Those polynomials do not have any common roots even in $\mathbb{C}$
P.S Sorry for asking such basic question but wasn't able to find any examples of the Extended Euclidean algorithm that involved polynomials with a degree more than two and used Euclidean algorithm instead of factoring
P.P.S. Sage Math code
f = x^3-x^2-1
g = x^2-3*x+1
f.gcd(g)
1
I didn't check your computations, but there is a basic misunderstanding in what you wrote. Asserting that $\gcd\bigl(p(x),q(x)\bigr)=-\frac{11}{25}$ or asserting that $\gcd\bigl(p(x),q(x)\bigr)=1$ is the same thing. That because if $\gcd\bigl(p(x),q(x)\bigr)=r(x)$, then $\gcd\bigl(p(x),q(x)\bigr)=k\times r(x)$ for any $k\in\mathbb{Q}\setminus\{0\}$. We usually normalize the answer by taking the only monic polynomial which is a multiple of the one we got by applying the extended Euclidean algorithm.