Polynomial long division

In algebra, polynomial long division is an algorithm for dividing a polynomial by another polynomial of the same or lower degree, a generalized version of the familiar arithmetic technique called long division. It can be done easily by hand, because it separates an otherwise complex division problem into smaller ones. Polynomial long division is an algorithm that implements the Euclidean division of polynomials: starting from two polynomials A (the dividend) and B (the divisor) produces, if B is not zero, a quotient Q and a remainder R such that

A = BQ + R,

and either R = 0 or the degree of R is lower than the degree of B. These conditions uniquely define Q and R; the result R = 0 occurs if and only if the polynomial A has B as a factor. Thus long division is a means for testing whether one polynomial has another as a factor, and, if it does, for factoring it out.

Sometimes using a shorthand version called synthetic division is faster, with less writing and fewer calculations, especially when the divisor is a linear polynomial.

Polynomial long division is possible provided that the coefficients of the polynomials belong to the same field, meaning that division by nonzero elements is always possible; examples of fields include the rational numbers, real numbers, and complex numbers.