In mathematics, an expansion of a product of sums expresses it as a sum of products by using the fact that multiplication distributes over addition. Expansion of a polynomial expression can be obtained by repeatedly replacing subexpressions that multiply two other subexpressions, at least one of which is an addition, by the equivalent sum of products, continuing until the expression becomes a sum of (repeated) products. During the expansion, simplifications such as grouping of like terms or cancellations of terms may also be applied. Instead of multiplications, the expansion steps could also involve replacing powers of a sum of terms by the equivalent expression obtained from the binomial formula; this is a shortened form of what would happen if the power were treated as a repeated multiplication, and expanded repeatedly. It is customary to reintroduce powers in the final result when terms involve products of identical symbols.
Simple examples of polynomial expansions are the well known rules
when used from left to right. A more general single-step expansion will introduce all products of a term of one of the sums being multiplied with a term of the other:
An expansion which involves multiple nested rewrite steps is that of working out a Horner scheme to the (expanded) polynomial it defines, for instance
The opposite process of trying to write an expanded polynomial as a product is called polynomial factorization.
Expansion of a polynomial written in factored form
To multiply two factors, each term of the first factor must be multiplied by each term of the other factor. If both factors are binomials, the FOIL rule can be used, which stands for "First Outer Inner Last," referring to the terms that are multiplied together. For example, expanding
Expansion of (x+y)n
Main article: Binomial theorem
When expanding , a special relationship exists between the coefficients of the terms when written in order of descending powers of x and ascending powers of y. The coefficients will be the numbers in the (n + 1)th row of Pascal's triangle.
For example, when expanding , the following is obtained: