Multiplying Polynomials

Algebra

Multiplying polynomials means applying the distributive property to multiply every term of one polynomial by every term of the other, then combining like terms.

Visualization

Definition

Multiplying polynomials means multiplying every term of the first polynomial by every term of the second (repeated distribution), then combining like terms; the result has degree equal to the sum of the two factors' degrees, and special patterns like the difference of squares or perfect square trinomial speed up common cases. Formally, for $f = \sum a_ix^i$ and $g = \sum b_jx^j$, the product is $(fg)(x) = \sum_{k} \left(\sum_{i+j=k} a_ib_j\right) x^k$, the Cauchy product (convolution) of the coefficient sequences; fast polynomial multiplication can be done in $O(n \log n)$ time using the Fast Fourier Transform, the basis for fast integer multiplication algorithms.

Example

$(x + 2)(x + 5) = x^2 + 5x + 2x + 10 = x^2 + 7x + 10$. $(2x - 3)(x^2 + x - 4) = 2x^3 + 2x^2 - 8x - 3x^2 - 3x + 12 = 2x^3 - x^2 - 11x + 12$. The coefficient of $x^3$ in $(a_0+a_1x+a_2x^2)(b_0+b_1x+b_2x^2)$ is $a_0b_3 + a_1b_2 + a_2b_1 + a_3b_0$, the convolution at index $3$.

Key Insight

Think of it like multiplying large numbers, every digit in one multiplies every digit in the other; for a $3$-term times a $3$-term polynomial, that means $9$ multiplication steps before combining like terms. Viewing multiplication as convolution connects it to signal processing, and FFT-based polynomial multiplication underlies modern computer arithmetic.