text: Factoring To find the GCD of two polynomials using factoring, simply factor the two polynomials completely.  Then, take the product of all common factors.  At this stage, we do not necessarily have a monic polynomial, so finally multiply this by a constant to make it a monic polynomial.  This will be the GCD of the two polynomials as it includes all common divisors and is monic.
  Example one: Find the GCD of  and .
  Thus, their GCD is .
  Euclidean algorithm
  Factoring polynomials can be difficult, especially if the polynomials have a large degree. The Euclidean algorithm is a method that works for any pair of polynomials. It makes repeated use of Euclidean division. When using this algorithm on two numbers, the size of the numbers decreases at each stage. With polynomials, the degree of the polynomials decreases at each stage. The last nonzero remainder, made monic if necessary, is the GCD of the two polynomials.
  More specifically, for finding the gcd of two polynomials  and , one can suppose  (otherwise, the GCD is ), and
  The Euclidean division provides two polynomials , the quotient and , the remainder such that
  A polynomial  divides both  and  if and only if it divides both  and . Thus
  Setting
  one can repeat the Euclidean division to get new polynomials  and so on. At each stage we have