Synthetic division

Last updated
Animation showing the use of synthetic division to find the quotient of
2
x
4
+
3
x
2
+
5
x
+
1
{\displaystyle 2x^{4}+3x^{2}+5x+1}
by
x
-
2
{\displaystyle x-2}
. Note that there is no term in
x
3
{\displaystyle x^{3}}
, so the fourth column from the right contains a zero. Synthdiv.gif
Animation showing the use of synthetic division to find the quotient of by . Note that there is no term in , so the fourth column from the right contains a zero.

In algebra, synthetic division is a method for manually performing Euclidean division of polynomials, with less writing and fewer calculations than long division.

Contents

It is mostly taught for division by linear monic polynomials (known as Ruffini's rule), but the method can be generalized to division by any polynomial.

The advantages of synthetic division are that it allows one to calculate without writing variables, it uses few calculations, and it takes significantly less space on paper than long division. Also, the subtractions in long division are converted to additions by switching the signs at the very beginning, helping to prevent sign errors.

Regular synthetic division

The first example is synthetic division with only a monic linear denominator .

The numerator can be written as .

The zero of the denominator is .

The coefficients of are arranged as follows, with the zero of on the left:

The first coefficient after the bar is "dropped" to the last row.

The dropped number is multiplied by the number before the bar and placed in the next column.

An addition is performed in the next column.

The previous two steps are repeated, and the following is obtained:

Here, the last term (-123) is the remainder while the rest correspond to the coefficients of the quotient.

The terms are written with increasing degree from right to left beginning with degree zero for the remainder and the result.

Hence the quotient and remainder are:

Evaluating polynomials by the remainder theorem

The above form of synthetic division is useful in the context of the polynomial remainder theorem for evaluating univariate polynomials. To summarize, the value of at is equal to the remainder of the division of by

The advantage of calculating the value this way is that it requires just over half as many multiplication steps as naive evaluation. An alternative evaluation strategy is Horner's method.

Expanded synthetic division

This method generalizes to division by any monic polynomial with only a slight modification with changes in bold. Note that while it may not be displayed in the following example, the divisor must also be written with verbose coefficients. (Such as with ) Using the same steps as before, perform the following division:

We concern ourselves only with the coefficients. Write the coefficients of the polynomial to be divided at the top.

Negate the coefficients of the divisor.

Write in every coefficient but the first one on the left in an upward right diagonal (see next diagram).

Note the change of sign from 1 to 1 and from 3 to 3. "Drop" the first coefficient after the bar to the last row.

Multiply the dropped number by the diagonal before the bar and place the resulting entries diagonally to the right from the dropped entry.

Perform an addition in the next column.

Repeat the previous two steps until you would go past the entries at the top with the next diagonal.

Then simply add up any remaining columns.

Count the terms to the left of the bar. Since there are two, the remainder has degree one and this is the two right-most terms under the bar. Mark the separation with a vertical bar.

The terms are written with increasing degree from right to left beginning with degree zero for both the remainder and the result.

The result of our division is:

For non-monic divisors

With a little prodding, the expanded technique may be generalised even further to work for any polynomial, not just monics. The usual way of doing this would be to divide the divisor with its leading coefficient (call it a):

then using synthetic division with as the divisor, and then dividing the quotient by a to get the quotient of the original division (the remainder stays the same). But this often produces unsightly fractions which get removed later and is thus more prone to error. It is possible to do it without first reducing the coefficients of .

As can be observed by first performing long division with such a non-monic divisor, the coefficients of are divided by the leading coefficient of after "dropping", and before multiplying.

Let's illustrate by performing the following division:

A slightly modified table is used:

Note the extra row at the bottom. This is used to write values found by dividing the "dropped" values by the leading coefficient of (in this case, indicated by the /3; note that, unlike the rest of the coefficients of , the sign of this number is not changed).

Next, the first coefficient of is dropped as usual:

and then the dropped value is divided by 3 and placed in the row below:

Next, the new (divided) value is used to fill the top rows with multiples of 2 and 1, as in the expanded technique:

The 5 is dropped next, with the obligatory adding of the 4 below it, and the answer is divided again:

Then the 3 is used to fill the top rows:

At this point, if, after getting the third sum, we were to try and use it to fill the top rows, we would "fall off" the right side, thus the third sum is the first coefficient of the remainder, as in regular synthetic division. But the values of the remainder are not divided by the leading coefficient of the divisor:

Now we can read off the coefficients of the answer. As in expanded synthetic division, the last two values (2 is the degree of the divisor) are the coefficients of the remainder, and the remaining values are the coefficients of the quotient:

and the result is

Compact Expanded Synthetic Division

However, the diagonal format above becomes less space-efficient when the degree of the divisor exceeds half of the degree of the dividend. Consider the following division:

It is easy to see that we have complete freedom to write each product in any row as long as it is in the correct column, so the algorithm can be compactified by a greedy strategy, as illustrated in the division below:

The following describes how to perform the algorithm; this algorithm includes steps for dividing non-monic divisors:

  1. Write the coefficients of the dividend on a bar.
  2. Ignoring the first (leading) coefficient of the divisor, negate each coefficients and place them on the left-hand side of the bar.
  3. From the number of coefficients placed on the left side of the bar, count the number of dividend coefficients above the bar, starting from the rightmost column. Then place a vertical bar to the left, and as well as the row below, of that column. This vertical bar marks the separation between the quotient and the remainder.
  4. Drop the first coefficient of the dividend below the bar.
    • Divide the previously dropped/summed number by the leading coefficient of the divisor and place it on the row below (this doesn't need to be done if the leading coefficient is 1).
      In this case , where the index has been chosen by subtracting the index of the divisor from the dividend.
    • Multiply the previously dropped/summed number (or the divided dropped/summed number) to each negated divisor coefficients on the left (starting with the left most); skip if the dropped/summed number is zero. Place each product on top of the subsequent columns.
  5. Perform a column-wise addition on the next column. In this case, .
  6. Repeat the previous two steps. Stop when you performed the previous two steps on the number just before the vertical bar.
    1. Let .
    2. Let .
    3. Let .
  7. Perform the remaining column-wise additions on the subsequent columns (calculating the remainder).
  8. The bottommost results below the horizontal bar are coefficients of the polynomials (the quotient and the remainder), where the coefficients of the quotient are to the left of the vertical bar separation and the coefficients of the remainder are to the right. These coefficients are interpreted as having increasing degree from right to left, beginning with degree zero for both the quotient and the remainder.
    We interpret the results to get:

Python implementation

The following snippet implements Expanded Synthetic Division in Python for arbitrary univariate polynomials:

defexpanded_synthetic_division(dividend,divisor):"""Fast polynomial division by using Expanded Synthetic Division.     Also works with non-monic polynomials.    Dividend and divisor are both polynomials, which are here simply lists of coefficients.     E.g.: x**2 + 3*x + 5 will be represented as [1, 3, 5]    """out=list(dividend)# Copy the dividendnormalizer=divisor[0]foriinrange(len(dividend)-len(divisor)+1):# For general polynomial division (when polynomials are non-monic),# we need to normalize by dividing the coefficient with the divisor's first coefficientout[i]/=normalizercoef=out[i]ifcoef!=0:# Useless to multiply if coef is 0# In synthetic division, we always skip the first coefficient of the divisor,# because it is only used to normalize the dividend coefficientsforjinrange(1,len(divisor)):out[i+j]+=-divisor[j]*coef# The resulting out contains both the quotient and the remainder,# the remainder being the size of the divisor (the remainder# has necessarily the same degree as the divisor since it is# what we couldn't divide from the dividend), so we compute the index# where this separation is, and return the quotient and remainder.separator=1-len(divisor)returnout[:separator],out[separator:]# Return quotient, remainder.

See also

Related Research Articles

In mathematics, Bézout's identity, named after Étienne Bézout who proved it for polynomials, is the following theorem:

<span class="mw-page-title-main">Chinese remainder theorem</span> Theorem for solving simultaneous congruences

In mathematics, the Chinese remainder theorem states that if one knows the remainders of the Euclidean division of an integer n by several integers, then one can determine uniquely the remainder of the division of n by the product of these integers, under the condition that the divisors are pairwise coprime.

<span class="mw-page-title-main">Euclidean algorithm</span> Algorithm for computing greatest common divisors

In mathematics, the Euclidean algorithm, or Euclid's algorithm, is an efficient method for computing the greatest common divisor (GCD) of two integers (numbers), the largest number that divides them both without a remainder. It is named after the ancient Greek mathematician Euclid, who first described it in his Elements . It is an example of an algorithm, a step-by-step procedure for performing a calculation according to well-defined rules, and is one of the oldest algorithms in common use. It can be used to reduce fractions to their simplest form, and is a part of many other number-theoretic and cryptographic calculations.

In mathematics, a polynomial is a mathematical expression consisting of indeterminates and coefficients, that involves only the operations of addition, subtraction, multiplication and exponentiation to nonnegative integer powers, and has a finite number of terms. An example of a polynomial of a single indeterminate x is x2 − 4x + 7. An example with three indeterminates is x3 + 2xyz2yz + 1.

A cyclic redundancy check (CRC) is an error-detecting code commonly used in digital networks and storage devices to detect accidental changes to digital data. Blocks of data entering these systems get a short check value attached, based on the remainder of a polynomial division of their contents. On retrieval, the calculation is repeated and, in the event the check values do not match, corrective action can be taken against data corruption. CRCs can be used for error correction.

<span class="mw-page-title-main">Division (mathematics)</span> Arithmetic operation

Division is one of the four basic operations of arithmetic. The other operations are addition, subtraction, and multiplication. What is being divided is called the dividend, which is divided by the divisor, and the result is called the quotient.

<span class="mw-page-title-main">Factorization</span> (Mathematical) decomposition into a product

In mathematics, factorization (or factorisation, see English spelling differences) or factoring consists of writing a number or another mathematical object as a product of several factors, usually smaller or simpler objects of the same kind. For example, 3 × 5 is an integer factorization of 15, and (x – 2)(x + 2) is a polynomial factorization of x2 – 4.

In arithmetic and computer programming, the extended Euclidean algorithm is an extension to the Euclidean algorithm, and computes, in addition to the greatest common divisor (gcd) of integers a and b, also the coefficients of Bézout's identity, which are integers x and y such that

In algebra, the partial fraction decomposition or partial fraction expansion of a rational fraction is an operation that consists of expressing the fraction as a sum of a polynomial and one or several fractions with a simpler denominator.

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. Sometimes using a shorthand version called synthetic division is faster, with less writing and fewer calculations. Another abbreviated method is polynomial short division.

<span class="mw-page-title-main">Euclidean division</span> Division with remainder of integers

In arithmetic, Euclidean division – or division with remainder – is the process of dividing one integer by another, in a way that produces an integer quotient and a natural number remainder strictly smaller than the absolute value of the divisor. A fundamental property is that the quotient and the remainder exist and are unique, under some conditions. Because of this uniqueness, Euclidean division is often considered without referring to any method of computation, and without explicitly computing the quotient and the remainder. The methods of computation are called integer division algorithms, the best known of which being long division.

In mathematics, the Kronecker product, sometimes denoted by ⊗, is an operation on two matrices of arbitrary size resulting in a block matrix. It is a specialization of the tensor product from vectors to matrices and gives the matrix of the tensor product linear map with respect to a standard choice of basis. The Kronecker product is to be distinguished from the usual matrix multiplication, which is an entirely different operation. The Kronecker product is also sometimes called matrix direct product.

In mathematics, Ruffini's rule is a method for computation of the Euclidean division of a polynomial by a binomial of the form x – r. It was described by Paolo Ruffini in 1809. The rule is a special case of synthetic division in which the divisor is a linear factor.

In algebra, the polynomial remainder theorem or little Bézout's theorem is an application of Euclidean division of polynomials. It states that, for every number any polynomial is the sum of and the product by of a polynomial in of degree less than the degree of In particular, is the remainder of the Euclidean division of by and is a divisor of if and only if a property known as the factor theorem.

In mathematics, the Sturm sequence of a univariate polynomial p is a sequence of polynomials associated with p and its derivative by a variant of Euclid's algorithm for polynomials. Sturm's theorem expresses the number of distinct real roots of p located in an interval in terms of the number of changes of signs of the values of the Sturm sequence at the bounds of the interval. Applied to the interval of all the real numbers, it gives the total number of real roots of p.

In mathematics, the resultant of two polynomials is a polynomial expression of their coefficients that is equal to zero if and only if the polynomials have a common root, or, equivalently, a common factor. In some older texts, the resultant is also called the eliminant.

In algebra, the greatest common divisor of two polynomials is a polynomial, of the highest possible degree, that is a factor of both the two original polynomials. This concept is analogous to the greatest common divisor of two integers.

In arithmetic, short division is a division algorithm which breaks down a division problem into a series of easier steps. It is an abbreviated form of long division — whereby the products are omitted and the partial remainders are notated as superscripts.

In mathematics, the Khatri–Rao product or block Kronecker product of two partitioned matrices and is defined as

References