In an answer to the question Resultant of Two Univariate Polynomials, a PDF of course slides was linked which describes a modification of Euclid's algorithm for computing univariate polynomial resultants (reference: http://www.csd.uwo.ca/~eschost/publications/CS829-lecture3.pdf - slide 53).
The algorithm is as follows (with F, G the input polynomials, d_i the degree of F_i, and LC(p) the leading coefficient of p):
F_1 := F
F_2 := G
i := 2
R_1 := 1
while deg(F_i) > 0:
F_{i+1} := F_{i-1} mod F_i
R_i := (-1)^{d_i * d_{i-1}} * LC(F_i)^{d_{i-1} - d_i} * R_{i-1}
i++
if F_i != 0 then return R_{i-1} * LC(F_i)^{d_{i-1}}
else return 0
However, this algorithm is incorrect, though I am not sure `where' the bug is.
To see that it is incorrect, consider the following two polynomials in Q[x]:
f(x) = x^2 - 2x - 1,
g(x) = x^2 - 3.
Then, the algorithm given above computes that
Resultant(f,g) = 4
whereas the correct result is
Resultant(f,g) = -8.
This correct result is easily verified e.g. via Sage:
sage: x, = QQ['x'].gens()
sage: f = x^2 - 2*x - 1
sage: g = x^2 - 3
sage: f.resultant(g)
-8
Where is the bug in the resultant algorithm given in those slides? Or, alternatively, what is a correct modification of Euclid's algorithm sufficient for computing the resultant of two univariate polynomials in Q[x]? Please note that I am not looking for methods based on subresultant PRS's, but rather for a `simple' modification of Euclid's algorithm sufficient for computing the resultant of two univariate polynomials. (Of course, the resulting method will be far less efficient than subresultant-based methods. On the other hand, it should be much easier to understand, implement and teach.)
Thank you.