# .

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 are 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

$$(x+y)^2=x^2+2xy+y^2$$
$$(x+y)(x-y)=x^2-y^2$$

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:

$$(a+b+c+d)(x+y+z)=ax+ay+az+bx+by+bz+cx+cy+cz+dx+dy+dz$$

An expansion which involves multiple nested rewrite steps is that of working out a Horner scheme to the (expanded) polynomial it defines, for instance

$$1+x(-3+x(4+x(0+x(-12+x\cdot 2))))=1-3x+4x^2-12x^4+2x^5.$$

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

$$(x+2)(2x-5)\,$$

yields

$$2x^2-5x+4x-10 = 2x^2-x-10.$$

Expansion of $$(x+y)^n$$

Main article: Binomial theorem

When expanding $$(x+y)^n$$, 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 (x+y)^6, the following is obtained:

$$1x^6+6x^5y+15x^4y^2+20x^3y^3+15x^2y^4+6xy^5+1y^6 \,$$

Polynomial factorization
Factorization
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "https://www.scientificlib.com/en/Mathematics/LX/PolynomialExpansion.html", "fetch_time": 1675642750000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2023-06/segments/1674764500294.64/warc/CC-MAIN-20230205224620-20230206014620-00825.warc.gz", "warc_record_offset": 981626901, "warc_record_length": 3979, "token_count": 634, "char_count": 2483, "score": 4.53125, "int_score": 5, "crawl": "CC-MAIN-2023-06", "snapshot_type": "latest", "language": "en", "language_score": 0.9438062310218811, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00037-of-00064.parquet"}