From Wikipedia, the free encyclopedia
Jump to: navigation, search
The polynomial x2 + cx + d, where a + b = c and ab = d, can be factorized into (x + a)(x + b).

In mathematics, factorization (also factorisation in some forms of British English) or factoring is the decomposition of a mathematical object (for example, a number, a polynomial, or a matrix) into a product of other objects, or factors, which when multiplied together give the original. For example, the number 15 factors into primes as 3 × 5, and the polynomial x2 − 4 factors as (x − 2)(x + 2). In all cases, a product of simpler objects is obtained.

The aim of factoring is usually to reduce something to “basic building blocks” that cannot be further factored, such as numbers to prime numbers, or polynomials to irreducible polynomials. Factoring integers is covered by the fundamental theorem of arithmetic and factoring polynomials by the fundamental theorem of algebra. Viète's formulas relate the coefficients of a polynomial to its roots, which appear in the polynomial's factors.

The opposite of integer factorization is integer multiplication to obtain a product, the opposite of polynomial factorization is expansion, the multiplying together of polynomial factors to an “expanded” polynomial, written as just a sum of terms.

Integer factorization for large integers appears to be a difficult problem. There is no known method to carry it out quickly, and its complexity is the basis of the assumed security of some public key cryptography algorithms, such as RSA.

A matrix can also be factorized into a product of matrices of special types, for an application in which that form is convenient. One major example of this uses an orthogonal or unitary matrix, and a triangular matrix. There are different types: QR decomposition, LQ, QL, RQ, RZ.

Another example is the factorization of a function as the composition of other functions having certain properties; for example, every function can be viewed as the composition of a surjective function with an injective function. This situation is generalized by factorization systems.


By the fundamental theorem of arithmetic, every positive integer greater than 1 has a unique prime factorization. Given an algorithm for integer factorization, one can factor any integer down to its constituent primes by repeated application of this algorithm,[1] for very large numbers, no efficient classical algorithm is known.

The most elementary way of factoring, i.e., decomposing a number into its prime factors, is trial division: for each prime number 2, 3, 5, 7, 11, ..., not exceeding the square root of the "target" integer (remaining) to be factored, one would test divisibility by that prime. If it divides, then one has to check whether a higher power of it would also divide the number, before continuing factorization of the remaining number (i.e., after division by that prime power) with the next larger trial divisor. Once the remaining number is less than the square of the trial divisor, one may stop and conclude that the remaining number is prime itself, and thus the largest prime factor of the number to be factored initially.

Some comments are in order:

  • It causes only a performance hit, but not a wrong result, if non-primes are considered for trial division. (If a trial divisor is composite, then its factors are smaller primes for which it is already established that they don't divide the remaining number, so the trial division will yield a negative result.) Simple implementations use all odd numbers instead of only odd primes. If one wishes to avoid this performance hit, one has to use a list of primes either already computed, or to be computed (maybe incrementally) using, e.g., the sieve of Eratosthenes.
  • When doing the trial divisions by hand, simple divisibility "rules" (or criteria) can be used, in particular considering the last digit (for divisibility by 2 and 5) and the digit sum (for divisibility by 3 or a power thereof). At worst, the division has to be carried out only up to a point where it can be seen that the "trial divisor" does not evenly divide the "target" number.


To factor the number n = 1386:

  • Start with trial division by 2: The number is obviously even, so we have n = 2 · n' with n' = 1386 / 2 = 693. This is odd, so there is no higher power of 2 dividing n'.
  • Continue trial division of n' = 693 by 3. We see that the sum of digits is divisible by 3, and actually even by 3² = 9, so we have n' = 3² · n" with n" = 693 / 9 = 231 / 3 = 77. (A somewhat experienced calculator would remark that 231 = 21 · 11, the middle digit being sum of the first and last one, and therefore 231 / 3 = 7 · 11.) This result is not further divisible by 3.
  • Continue trial division of n" = 77 by 5: The last digit of n" shows that 5 does not divide.
  • Continue trial division of n" = 77 by 7: It is easily seen that n" = 7 · 11.
  • The remaining factor 11 is less than (7+2)² = 81 (knowing that the next prime must be ≥ 7 + 2), so we can conclude that it is a prime, even without computing the next larger "test" prime. So the factorization of, e.g., 9954 = 2 · 3² · 7 · 79 would not have taken more steps.)

At this point we can collect and summarize the result that n = 1386 = 2 · 3² · 7 · 11.

Remark: If, after (trial) division by 7, we try to divide the remaining factor by the next larger odd number, 9 (rather than the next prime, 11), we would simply find that 9 does not divide this remaining factor, and if it is less than (9+2)², we can again infer that it must be a prime. Subsequent odd numbers 13, 17 and 19 are prime, while 15 is obviously a multiple of 5 and doesn't need to be checked. So the next "useless" trial divisor would not occur before 21.


Modern techniques for factoring polynomials are fast and efficient, but use sophisticated mathematical ideas (see Factorization of polynomials), these techniques are used in the construction of computer routines for carrying out polynomial factorization in computer algebra systems. The more classical hand techniques rely on either the polynomial to be factored having low degree or the recognition of the polynomial as belonging to a certain class of known examples; these hand techniques are not very suitable for computer implementation. This article is concerned with these classical techniques.

While the general notion of factoring just means writing an expression as a product of simpler expressions, the vague term "simpler" will be defined more precisely for special classes of expressions. When factoring polynomials this means that the factors are to be polynomials of smaller degree. Thus, while is a factorization of the expression, it is not a polynomial factorization since the factors are not polynomials.[2] Also, the factoring of a constant term, as in would not be considered a polynomial factorization since one of the factors does not have a smaller degree than the original expression.[3] Another issue concerns the coefficients of the factors; in basic treatments it is desirable to have the coefficients of the factors be of the same type as the coefficients of the original polynomial—that is, factoring polynomials with integer coefficients into factors with integer coefficients, or factoring polynomials with real coefficients into polynomials with real coefficients. It is not always possible to do this, and a polynomial that can not be factored in this way is said to be irreducible over this type of coefficient. Thus, x2 – 2 is irreducible over the integers and x2 + 4 is irreducible over the reals; in the first example, the integers 1 and 2 can also be thought of as real numbers, and then shows that this polynomial factors over the reals (sometimes it is said that the polynomial splits over the reals). Similarly, since the integers 1 and 4 can be thought of as real and hence complex numbers, x2 + 4 splits over the complex numbers, i.e. .

The fundamental theorem of algebra can be stated as: Every polynomial of degree n with complex number coefficients splits completely into n linear factors.[4] The terms in these factors, which are the roots of the polynomial, may be real or complex, since complex roots of polynomials with real coefficients come in complex conjugate pairs, this result implies that every polynomial with real coefficients splits into linear and/or irreducible quadratic factors with real coefficients (because when two linear factors with complex conjugate terms are multiplied together, the result is a quadratic with real coefficients). Even though the structure of the factorization is known in these cases, finding the actual factors can be computationally challenging, and by the Abel–Ruffini theorem the coefficients and additive terms in the factors may not be expressible in terms of radicals.

History of factoring polynomials[edit]

Students who are introduced to factoring as a primary method of solving quadratic equations might be surprised to know it is one of the newest methods of solving them. Vera Sanford points out in her A Short History of Mathematics (1930)[5] that “In view of the present emphasis given to the solution of quadratic equations by factoring, it is interesting to note that this method was not used until Harriot’s work of 1631. Even in this case, however, the author ignores the factors that give rise to negative roots.” Harriot died in 1621, and like all his books, this one, Artis Analyticae Praxis ad Aequationes Algebraicas Resolvendas, was published after his death. An article on Harriot at the Univ of Saint Andrews math history web site says that in his personal writing on solving equations Harriot did use both positive and negative solutions, but his editor, Walter Warner, did not present this in his book. Harriot’s method of factoring may look different than what modern students expect; in the first section (Sectio Prima) Harriot draws tables to illustrate the addition, subtraction, multiplication and division of monomial, binomial, and trinomial terms. Then in the second section he shows a more direct multiplication that provides the foundation to his factoring method, he sets up the equation aaba + ca = + bc, and shows that this matches the form of multiplication he has previously provided as,

ab   aaba  
    (===)         (Harriot uses the long equal sign introduced by Robert Recorde)
a + c   cabc  

thus factoring the four terms of the adjusted expression aaba + cabc. This example can be seen on page 16 of the Artis Analyticae Praxis ad Aequationes Algebraicas Resolvendas.

Harriot writes out a form for each of the possibilities of (a ± b)(a ± c) with a being the unknown (where we might use x today) and then when he needs to factor he picks on one of the forms that match. By separating out the linear coefficient into two parts he is able to break the problem into one of the forms.

General methods[edit]

There are general algorithms which always produce the complete factorization of any polynomial, in either one variable (the univariate case) or several variables (the multivariate case); see Factorization of polynomials. These algorithms are implemented and are available in most computer algebra systems, they involve advanced properties of polynomials, and are too complicated for hand-written computation. There are also a few elementary methods which are well–suited for hand-written computation, and do not always allow finding the complete factorization in degree higher than four.

Highest common factor[edit]

Finding, by inspection, the monomial that is the highest common factor (also called the greatest common divisor) of all the terms of the polynomial and factoring it out as a common factor is an application of the distributive law. This is the most commonly used factoring technique, for example:[6]

Factoring by grouping[edit]

A method that is sometimes useful, but not guaranteed to work, is factoring by grouping.

Factoring by grouping is done by placing the terms in the polynomial into two or more groups, where each group can be factored by a known method, the results of these partial factorizations can sometimes be combined to give a factorization of the original expression.

For example, to factor the polynomial

  1. group similar terms,
  2. factor out the highest common factor in each grouping,
  3. again factor out the binomial common factor,

While grouping may not lead to a factorization in general, if the polynomial expression to be factored consists of four terms and is the result of multiplying two binomial expressions (by the FOIL method for instance), then the grouping technique can lead to a factorization, as in the above example.

Using the factor theorem[edit]

For a univariate polynomial, p(x), the factor theorem states that a is a root of the polynomial (that is, p(a) = 0, also called a zero of the polynomial) if and only if (xa) is a factor of p(x). The other factor in such a factorization of p(x) can be obtained by polynomial long division or synthetic division.

For example, consider the polynomial By inspection we see that 1 is a root of this polynomial (observe that the coefficients add up to 0), so (x – 1) is a factor of the polynomial. By long division we have

Univariate case, using the properties of roots[edit]

When a univariate polynomial is completely factored into linear factors (degree one factors), all of the roots of the polynomial are visible and by multiplying the factors together again, the relationship between the roots and the coefficients can be observed. Formally, these relationships are known as Vieta's formulas, these formulas do not help factorizing the polynomial except as a guide to making good guesses at what possible roots may be. However, if some additional information about the roots is known, this can be combined with the formulas to obtain the roots and thus the factorization.

For example,[7] we can factor if we know that the sum of two of its roots is zero. Let and be the three roots of this polynomial. Then Vieta's formulas are:

Assuming that immediately gives and reduces the other two equations to Thus the roots are 5, 4 and –4 and we have

Finding rational roots[edit]

If a (univariate) polynomial, f(x), has a rational root, p/q (p and q are integers and q ≠ 0), then by the factor theorem f(x) has the factor,

If, in addition, the polynomial f(x) has integer coefficients, then q must evenly divide the integer portion of the highest common factor of the terms of the polynomial, and, in the factorization of f(x), only the factor (qxp) will be visible.

If a (univariate) polynomial with integer coefficients, say,

has a rational root p/q, where p and q are integers that are relatively prime, then by the rational root test p is an integer divisor of an and q is an integer divisor of a0.[8]

If we wished to factorize the polynomial we could look for rational roots p/q where p divides –6, q divides 2 and p and q have no common factor greater than 1. By inspection we see that this polynomial can have no negative roots. Assume that q = 2 (otherwise we would be looking for integer roots), substitute x = p/2 and set the polynomial equal to 0. By multiplying by 4, we obtain the polynomial equation that will have an integer solution of 1 or 3 if the original polynomial had a rational root of the type we seek. Since 3 is a solution of this equation (and 1 is not), the original polynomial had the rational root 3/2 and the corresponding factor (2x - 3). By polynomial long division we have the factorization

For a quadratic polynomial with integer coefficients having rational roots, the above considerations lead to a factorization technique known as the ac method of factorization.[9] Suppose that the quadratic polynomial with integer coefficients is:

and it has rational roots, p/q and u/v. (If the discriminant, , is a square number these exist, otherwise we have irrational or complex solutions, and there will be no rational roots.) Both q and v must be divisors of a so we may write these fractions with a common denominator of a, that is, they may be written as -r/a and -s/a (the use of the negatives is cosmetic and leads to a prettier final result.) Then,

So, we have:

where rs = ac and r + s = b. The ac method for factoring the quadratic polynomial is to find r and s, the two factors of the number ac whose sum is b and then use them in the factorization formula of the original quadratic above.

As an example consider the quadratic polynomial:

Inspection of the factors of ac = 36 leads to 4 + 9 = 13 = b.

Recognizable patterns[edit]

While taking the product of two (or more) expressions can be done by following a multiplication algorithm, the reverse process of factoring relies frequently on the recognition of a pattern in the expression to be factored and recalling how such a pattern arises, the following are some well known patterns.[10]

Difference of two squares[edit]

A common type of algebraic factoring is for the difference of two squares, it is the application of the formula

to any two terms, whether or not they are perfect squares.

This basic form is often used with more complicated expressions that may not at first look like the difference of two squares, for example,

Sum/difference of two cubes[edit]

A visual representation of the factorization of cubes using volumes. For a sum of cubes, simply substitute z=-y.

Another formula for factoring is for the sum or difference of two cubes, the sum can be factored by

and the difference by

Difference of two fourth powers[edit]

Two formulas for factoring the difference of two fourth powers are as follows:

Sum/difference of two nth powers[edit]

  • Difference, even n

The above factorizations of differences or sums of powers can be extended to any positive integer power n.

For even n, we have

The first parenthetical term, and possibly the second one, can be further factored using the following formulas.

  • Difference, even or odd n

For any n, a general factorization is:

  • Sum, odd n

The corresponding formula for the sum of two nth powers depends on whether n is even or odd. If n is odd, b can be replaced by −b in the above formula, to give

  • Sum, even n

If n is even, we consider two cases:

  1. If n is a power of 2 then is unfactorable (more precisely, irreducible over the rational numbers).
  2. Otherwise, where m is odd. In this case we have,
  • Examples

Specifically, for some small values of n we have:

Sum/difference of two nth powers over the field of the real algebraic numbers[edit]

The above factorizations give factors with coefficients in the same field as those of the expression being factored—for example, a polynomial with rational coefficients (±1 in many cases above) is split into factors which themselves have rational coefficients. However, a factorization into factors with algebraic numbers (numbers that are the solution of some polynomial equation) as coefficients can yield lower-degree factors, as in the following formulas which can be proven by going through the complex conjugate roots of (The cosine expressions are algebraic numbers because they are trigonometric numbers.)

The sum of two terms that have equal even powers is factored by

The difference of two terms that have equal even powers is factored by

The sum or difference of two terms that have equal odd powers is factored by

For instance, the sum or difference of two fifth powers is factored by

and the sum of two fourth powers is factored by

Binomial expansions[edit]

Visualisation of binomial expansion up to the 4th power

The binomial theorem supplies patterns of coefficients that permit easily recognized factorizations when the polynomial is a power of a binomial expression.

For example, the perfect square trinomials are the quadratic polynomials that can be factored as follows:


Some cubic polynomials are four term perfect cubes that can be factored as:


In general, the coefficients of the expanded polynomial are given by the n-th row of Pascal's triangle. The coefficients of have the same absolute value but alternate in sign.

Other factorization formulas[edit]

Using formulas for polynomial roots[edit]

Any univariate quadratic polynomial (polynomials of the form ) can be factored over the field of complex numbers using the quadratic formula, as follows:

where and are the two roots of the polynomial, either both real or both complex in the case where a, b, c are all real, found with the quadratic formula.

The quadratic formula is valid for all polynomials with coefficients in any field (in particular, the real or complex numbers) except those that have characteristic two.[11]

There are also formulas for cubic and quartic polynomials which can be used in the same way. However, there are no algebraic formulas in terms of the coefficients that apply to all univariate polynomials of a higher degree, by the Abel–Ruffini theorem.

Factoring over the complex numbers[edit]

Sum of two squares[edit]

Even if a and b represent real numbers, the sum of their squares can be written as the product of non-real complex numbers. This produces the factorization formula:

For example, can be factored into .


Unique factorization domains[edit]

Euclidean domains[edit]


See also[edit]


  1. ^ Hardy; Wright (1980). An Introduction to the Theory of Numbers (5th ed.). Oxford Science Publications. ISBN 978-0198531715. 
  2. ^ Fite 1921, p. 20
  3. ^ Even if the 3 is thought of as a constant polynomial so that this could be considered a factorization into polynomials.
  4. ^ Klein 1925, pp. 101–102
  5. ^ Sanford, Vera (2008) [1930], A Short History of Mathematics, Read Books, ISBN 9781409727101 
  6. ^ Fite 1921, p. 19
  7. ^ Burnside & Panton 1960, p. 38
  8. ^ Dickson 1922, p. 27
  9. ^ Stover, Christopher AC Method - Mathworld
  10. ^ Selby 1970, p. 101
  11. ^ In these fields 2 = 0 so the division in the formula is not valid. There are other ways to find roots of quadratic equations over these fields.


  • Burnside, William Snow; Panton, Arthur William (1960) [1912], The Theory of Equations with an introduction to the theory of binary algebraic forms (Volume one), Dover 
  • Dickson, Leonard Eugene (1922), First Course in the Theory of Equations, New York: John Wiley & Sons 
  • Fite, William Benjamin (1921), College Algebra (Revised), Boston: D. C. Heath & Co. 
  • Klein, Felix (1925), Elementary Mathematics from an Advanced Standpoint; Arithmetic, Algebra, Analysis, Dover 
  • Selby, Samuel M., CRC Standard Mathematical Tables (18th ed.), The Chemical Rubber Co. 

External links[edit]