It depends on what the base ring is. In general in Sage you can use two question marks to look at the source code. For example:
sage: R.<x> = ZZ[]
sage: f = x^2 - 1
sage: f.gcd??
...
cdef Polynomial_integer_dense_flint _right = <Polynomial_integer_dense_flint> right
if self.is_zero() or _right.is_one():
return right
elif self.is_one() or _right.is_zero():
return self
cdef Polynomial_integer_dense_flint x = self._new()
sig_on()
fmpz_poly_gcd(x.__poly, self.__poly,
(<Polynomial_integer_dense_flint>right).__poly)
sig_off()
return x
So in this case Sage is delegating the work to
FLINT, so you''ll need to look at their documentation/source code to see what the algorithm used is.
David