Library/Algebra/Polynomials/Polynomial division with remainder. GCD and LCM of polynomials

Polynomial division with remainder. GCD and LCM of polynomials

Overview
Important

Just like with integers, we can divide one polynomial by another, and there will usually be a remainder. For polynomials f(x)f(x) and g(x)g(x) (with g(x)0g(x) \neq 0), there exist unique polynomials q(x)q(x) (the quotient) and r(x)r(x) (the remainder) such that:

f(x)=g(x)q(x)+r(x)f(x) = g(x)q(x) + r(x)

where the degree of r(x)r(x) is less than the degree of g(x)g(x). The greatest common divisor (GCD) of two polynomials is the highest-degree polynomial that divides both without remainder. The least common multiple (LCM) is the lowest-degree polynomial that both polynomials divide.

Important properties

  • The remainder r(x)r(x) has degree less than g(x)g(x) or is zero.

  • The quotient and remainder are unique for given f(x)f(x) and g(x)g(x).

  • The GCD of two polynomials can be found using the Euclidean algorithm, similar to integers.

  • Any two polynomials have a GCD and an LCM (up to multiplication by a nonzero constant).