Sub topic 11
Multiplying Larger Polynomials
Assume you can use the distributive property, combine like terms, and apply the product rule for exponents. This chapter extends binomial multiplication to polynomials with any number of terms.
Distribute Every Term
To multiply two polynomials, multiply every term in the first polynomial by every term in the second polynomial. Then combine like terms.
For example:
\[ (2x^2-x+3)(x^2+4x-5) \]
The first polynomial has three terms, and the second also has three terms. Each term in the first polynomial must be used three times:
\[ \begin{aligned} (2x^2-x+3)(x^2+4x-5) &=2x^2(x^2+4x-5)\\ &\quad-x(x^2+4x-5)\\ &\quad+3(x^2+4x-5) \end{aligned} \]
Now distribute within each row:
\[ \begin{aligned} &2x^4+8x^3-10x^2\\ &\quad-x^3-4x^2+5x\\ &\quad+3x^2+12x-15 \end{aligned} \]
Combine like terms:
\[ 2x^4+7x^3-11x^2+17x-15 \]
The exponents add when powers with the same base are multiplied. For example, \(x^2\cdot x^2=x^4\).
Organize the Work
A table can prevent missing or repeating a product. Use one polynomial for the rows and the other for the columns.
| Row | \(x^2\) | \(4x\) | \(-5\) |
|---|---|---|---|
| \(2x^2\) | \(2x^4\) | \(8x^3\) | \(-10x^2\) |
| \(-x\) | \(-x^3\) | \(-4x^2\) | \(5x\) |
| \(3\) | \(3x^2\) | \(12x\) | \(-15\) |
After filling the table, add all entries with the same power of \(x\).
Degree and Missing Terms
The degree of a nonzero polynomial is its greatest exponent. Before multiplying, the degree of a product is usually the sum of the degrees of the factors. In the example, the degrees are 2 and 2, so the product should have degree 4.
This prediction helps detect errors, but it is not enough by itself. The leading terms can cancel in some expressions, so the actual degree may be smaller.
When using a coefficient-list method, include zero coefficients for missing powers. For example,
\[ x^3+4x-2 \]
has coefficient list \([-2,4,0,1]\), because the \(x^2\) term is missing.
def multiply(p, q):
# Lists go from the constant coefficient upward.
result = [0] * (len(p) + len(q) - 1)
for i, a in enumerate(p):
for j, b in enumerate(q):
result[i + j] += a * b
return result
# (2 + x)(1 + 3x + x^2)
print(multiply([2, 1], [1, 3, 1]))
# [2, 7, 5, 1], representing x^3 + 5x^2 + 7x + 2Exercise
Expand \((x^2+2x-3)(2x^2-x+4)\).
Show answer
\(2x^4+3x^3-9x^2+11x-12\).