Learning Objectives

By the end of this section, you will be able to:

- Multiply monomials
- Multiply a polynomial by a monomial
- Multiply a binomial by a binomial
- Multiply a polynomial by a polynomial
- Multiply special products
- Multiply polynomial functions

Before you get started, take this readiness quiz.

- Distribute: (2(x+3)).

If you missed this problem, review__[link]__. - Simplify: ⓐ (9^2) ⓑ ((−9)^2) ⓒ (−9^2).

If you missed this problem, review__[link]__. - Evaluate: (2x^2−5x+3) for (x=−2).

If you missed this problem, review__[link]__.

## Multiply Monomials

We are ready to perform operations on polynomials. Since monomials are algebraic expressions, we can use the properties of exponents to multiply monomials.

Example (PageIndex{1})

Multiply:

- ((3x^2)(−4x^3))
- (left(frac{5}{6}x^3y ight)(12xy^2).)

**Answer a**(egin{array} {ll} {} &{(3x^2)(−4x^3)} { ext{Use the Commutative Property to rearrange the terms.}} &{3·(−4)·x^2·x^3} { ext{}} &{−12x^5} end{array} )

**Answer b**(egin{array} {ll} {} &{left(frac{5}{6}x^3y ight)(12xy^2)} { ext{Use the Commutative Property to rearrange the terms.}} &{frac{5}{6}·12·x^3·x·y·y^2} { ext{Multiply.}} &{10x^4y^3} end{array} )

Multiply:

- ((5y^7)(−7y^4))
- ((25a^4b^3)(15ab^3))

**Answer a**(−35y^{11})

**Answer b**(6a^5b^6)

Example (PageIndex{3})

Multiply:

- ((−6b^4)(−9b^5))
- ((23r^5s)(12r^6s^7).)

**Answer a**(54b^9)

**Answer b**(8r^{11}s^8)

## Multiply a Polynomial by a Monomial

Multiplying a polynomial by a monomial is really just applying the Distributive Property.

Example (PageIndex{4})

Multiply:

- (−2y(4y^2+3y−5))
- (3x^3y(x^2−8xy+y^2)).

**Answer a**Distribute. Multiply. **Answer b**(egin{array} {ll} {} &{3x^3y(x^2−8xy+y^2)} { ext{Distribute.}} &{3x^3y⋅x^2+(3x^3y)⋅(−8xy)+(3x^3y)⋅y^2} { ext{Multiply.}} &{3x^5y−24x^4y^2+3x^3y^3} end{array} )

Example (PageIndex{5})

Multiply:

- (-3y(5y^2+8y^{−7}))
- (4x^2y^2(3x^2−5xy+3y^2))

**Answer a**(−15y^3−24y^2+21y)

**Answer b**(12x^4y^2−20x^3y^3+12x^2y^4)

Example (PageIndex{6})

Multiply:

- (4x^2(2x^2−3x+5))
- (−6a^3b(3a^2−2ab+6b^2))

**Answer a**(−15y^3−24y^2+21y)

**Answer b**(−18a^5b+12a^4b^2−36a^3b^3)

## Multiply a Binomial by a Binomial

Just like there are different ways to represent multiplication of numbers, there are several methods that can be used to multiply a binomial times a binomial. We will start by using the Distributive Property.

Example (PageIndex{7})

Multiply:

- ((y+5)(y+8))
- ((4y+3)(2y−5)).

**Answer**ⓐ

Distribute ((y+8)). Distribute again. Combine like terms. ⓑ

Distribute. Distribute again. Combine like terms.

Example (PageIndex{8})

Multiply:

- ((x+8)(x+9))
- ((3c+4)(5c−2)).

**Answer a**(x^2+17x+72)

**Answer b**(15c^2+14c−8)

Example (PageIndex{9})

Multiply:

- ((5x+9)(4x+3))
- ((5y+2)(6y−3)).

**Answer a**(20x^2+51x+27)

**Answer b**(30y^2−3y−6)

If you multiply binomials often enough you may notice a pattern. Notice that the first term in the result is the product of the *first* terms in each binomial. The second and third terms are the product of multiplying the two *outer* terms and then the two *inner* terms. And the last term results from multiplying the two *last* terms,

We abbreviate “First, Outer, Inner, Last” as FOIL. The letters stand for ‘First, Outer, Inner, Last’. We use this as another method of multiplying binomials. The word FOIL is easy to remember and ensures we find all **four **products.

Let’s multiply ((x+3)(x+7)) using both methods.

We summarize the steps of the FOIL method below. The FOIL method only applies to multiplying binomials, not other polynomials!

DEFINITION: USE THE FOIL METHOD TO MULTIPLY TWO BINOMIALS.

When you multiply by the FOIL method, drawing the lines will help your brain focus on the pattern and make it easier to apply.

Now we will do an example where we use the FOIL pattern to multiply two binomials.

Example (PageIndex{10})

Multiply:

- ((y−7)(y+4))
- ((4x+3)(2x−5)).

**Answer**ⓐ

ⓑ

Multiply:

- ((x−7)(x+5))
- ((3x+7)(5x−2)).

**Answer**ⓐ (x^2−2x−35)

ⓑ (15x^2+29x−14)

Exercise (PageIndex{12})

Multiply:

- ((b−3)(b+6))
- ((4y+5)(4y−10)).

**Answer**ⓐ (b^2+3b−18)

ⓑ (16y^2−20y−50)

The final products in the last example were trinomials because we could combine the two middle terms. This is not always the case.

Example (PageIndex{14})

Multiply:

- ((x^2+6)(x−8))
- ((2ab+5)(4ab−4)).

**Answer**ⓐ (x^3−8x^2+6x−48)

ⓑ (8a^2b^2+12ab−20)

Example (PageIndex{15})

Multiply:

- ((y^2+7)(y−9))
- ((2xy+3)(4xy−5)).

**Answer**ⓐ (y^3−9y^2+7y−63)

ⓑ (8x^2y^2+2xy−15)

The FOIL method is usually the quickest method for multiplying two binomials, but it *only* works for binomials. You can use the Distributive Property to find the product of any two polynomials. Another method that works for all polynomials is the Vertical Method. It is very much like the method you use to multiply whole numbers. Look carefully at this example of multiplying two-digit numbers.

Now we’ll apply this same method to multiply two binomials.

Example (PageIndex{16})

Multiply using the Vertical Method: ((3y−1)(2y−6)).

**Answer**It does not matter which binomial goes on the top.

(egin{align*} & & &quad; ;;3y - 1[4pt]

& & &underline{quad imes ;2y-6}[4pt]

& ext{Multiply }3y-1 ext{ by }-6. & &quad -18y + 6 & & ext{partial product}[4pt]

& ext{Multiply }3y-1 ext{ by }2y. & & underline{6y^2 - 2y} & & ext{partial product}[4pt]

& ext{Add like terms.} & & 6y^2 - 20y + 6 end{align*} )Notice the partial products are the same as the terms in the FOIL method.

Example (PageIndex{17})

Multiply using the Vertical Method: ((5m−7)(3m−6)).

**Answer**(15m^2−51m+42)

Example (PageIndex{18})

Multiply using the Vertical Method: ((6b−5)(7b−3)).

**Answer**(42b^2−53b+15)

We have now used three methods for multiplying binomials. Be sure to practice each method, and try to decide which one you prefer. The methods are listed here all together, to help you remember them.

DEFINITION: MULTIPLYING TWO BINOMIALS

To multiply binomials, use the:

- Distributive Property
- FOIL Method
- Vertical Method

## Multiply a Polynomial by a Polynomial

We have multiplied monomials by monomials, monomials by polynomials, and binomials by binomials. Now we’re ready to multiply a polynomial by a polynomial. Remember, FOIL will not work in this case, but we can use either the Distributive Property or the Vertical Method.

Example (PageIndex{19})

Multiply ((b+3)(2b^2−5b+8)) using ⓐ the Distributive Property and ⓑ the Vertical Method.

**Answer**ⓐ

Distribute. Multiply. Combine like terms. ⓑ It is easier to put the polynomial with fewer terms on the bottom because we get fewer partial products this way.

Multiply ((2b^2−5b+8)) by 3.

Multiply ((2b^2−5b+8)) by (b).Add like terms.

Example (PageIndex{20})

Multiply ((y−3)(y^2−5y+2)) using ⓐ the Distributive Property and ⓑ the Vertical Method.

**Answer**ⓐ (y^3−8y2+17y−6)

ⓑ (y^3−8y2+17y−6)

Example (PageIndex{21})

Multiply ((x+4)(2x^2−3x+5)) using ⓐ the Distributive Property and ⓑ The Vertical Method.

**Answer**ⓐ (2x^3+5x^2−7x+20)

ⓑ (y^3−8y^2+17y−6)

We have now seen two methods you can use to multiply a polynomial by a polynomial. After you practice each method, you’ll probably find you prefer one way over the other. We list both methods are listed here, for easy reference.

DEFINITION: MULTIPLYING A POLYNOMIAL BY A POLYNOMIAL

To multiply a trinomial by a binomial, use the:

- Distributive Property
- Vertical Method

## Multiply Special Products

Mathematicians like to look for patterns that will make their work easier. A good example of this is squaring binomials. While you can always get the product by writing the binomial twice and multiplying them, there is less work to do if you learn to use a pattern. Let’s start by looking at three examples and look for a pattern.

Look at these results. Do you see any patterns?

What about the number of terms? In each example we squared a binomial and the result was a trinomial.

[(a+b)^2= ext{___}+ ext{___}+ ext{___} onumber]

Now look at the *first term* in each result. Where did it come from?

The first term is the product of the first terms of each binomial. Since the binomials are identical, it is just the square of the first term!

[(a+b)^2=a^2+ ext{___}+ ext{___} onumber]

*To get the first term of the product, square the first term.*

Where did the *last term* come from? Look at the examples and find the pattern.

The last term is the product of the last terms, which is the square of the last term.

[(a+b)^2= ext{___}+ ext{___}+b^2 onumber]

*To get the last term of the product, square the last term.*

Finally, look at the *middle term*. Notice it came from adding the “outer” and the “inner” terms—which are both the same! So the middle term is double the product of the two terms of the binomial.

[(a+b)^2= ext{___}+2ab+ ext{___} onumber]

[(a−b)^2= ext{___}−2ab+ ext{___} onumber]

*To get the middle term of the product, multiply the terms and double their product.*

Putting it all together:

definition: BINOMIAL SQUARES PATTERN

If *a* and *b* are real numbers,

To square a binomial, square the first term, square the last term, double their product.

Example (PageIndex{22})

Multiply: ⓐ ((x+5)^2) ⓑ ((2x−3y)^2).

**Answer**ⓐ

Square the first term. Square the last term. Double their product. Simplify. ⓑ

Use the pattern. Simplify.

Example (PageIndex{23})

Multiply: ⓐ((x+9)^2) ⓑ ((2c−d)^2).

**Answer**ⓐ (x^2+18x+81)

ⓑ (4c^2−4cd+d^2)

Example (PageIndex{24})

Multiply: ⓐ ((y+11)^2) ⓑ ((4x−5y)^2).

**Answer**ⓐ (y^2+22y+121)

ⓑ (16x^2−40xy+25y^2)

We just saw a pattern for squaring binomials that we can use to make multiplying some binomials easier. Similarly, there is a pattern for another product of binomials. But before we get to it, we need to introduce some vocabulary.

A pair of binomials that each have the same first term and the same last term, but one is a sum and one is a difference is called a **conjugate pair** and is of the form ((a−b)), ((a+b)).

definition: conjugate pair

A **conjugate pair** is two binomials of the form

[(a−b), (a+b). onumber]

The pair of binomials each have the same first term and the same last term, but one binomial is a sum and the other is a difference.

There is a nice pattern for finding the product of conjugates. You could, of course, simply FOIL to get the product, but using the pattern makes your work easier. Let’s look for the pattern by using FOIL to multiply some conjugate pairs.

What do you observe about the products?

The product of the two binomials is also a binomial! Most of the products resulting from FOIL have been trinomials.

Each *first term* is the product of the first terms of the binomials, and since they are identical it is the square of the first term.

[(a+b)(a−b)=a^2− ext{___} onumber]

*To get the first term, square the first term.*

The *last term* came from multiplying the last terms, the square of the last term.

[(a+b)(a−b)=a^2−b^2 onumber]

*To get the last term, square the last term*.

Why is there no middle term? Notice the two middle terms you get from FOIL combine to 0 in every case, the result of one addition and one subtraction.

The product of conjugates is always of the form (a^2−b^2). This is called a **difference of squares**.

This leads to the pattern:

definition: PRODUCT OF CONJUGATES PATTERN

If *a* and *b* are real numbers,

The product is called a difference of squares.

To multiply conjugates, square the first term, square the last term, write it as a difference of squares.

Example (PageIndex{26})

Multiply: ⓐ ((6x+5)(6x−5)) ⓑ ((4p−7q)(4p+7q)).

**Answer**ⓐ (36x^2−25)

ⓑ (16p^2−49q^2)

Example (PageIndex{27})

Multiply: ⓐ ((2x+7)(2x−7)) ⓑ((3x−y)(3x+y)).

**Answer**ⓐ (4x^2−49) ⓑ (9x^2−y^2)

We just developed special product patterns for Binomial Squares and for the Product of Conjugates. The products look similar, so it is important to recognize when it is appropriate to use each of these patterns and to notice how they differ. Look at the two patterns together and note their similarities and differences.

COMPARING THE SPECIAL PRODUCT PATTERNS

Binomial Squares | Product of Conjugates |
---|---|

((a+b)^2=a^2+2ab+b^2) | ((a−b)(a+b)=a^2−b^2) |

((a−b)^2=a^2−2ab+b^2) | |

• Squaring a binomial | • Multiplying conjugates |

• Product is a trinomial | • Product is a binomial. |

• Inner and outer terms with FOIL are the same. | • Inner and outer terms with FOIL are opposites. |

• Middle term is double the product of the terms | • There is no middle term. |

Example (PageIndex{28})

Choose the appropriate pattern and use it to find the product:

ⓐ ((2x−3)(2x+3)) ⓑ ((5x−8)^2) ⓒ ((6m+7)^2) ⓓ ((5x−6)(6x+5)).

**Answer**ⓐ ((2x−3)(2x+3))

These are conjugates. They have the same first numbers, and the same last numbers, and one binomial is a sum and the other is a difference. It fits the Product of Conjugates pattern.

Use the pattern. Simplify. ⓑ ((8x−5)^2)

We are asked to square a binomial. It fits the binomial squares pattern.

Use the pattern. Simplify. ⓒ ((6m+7)^2)

Again, we will square a binomial so we use the binomial squares pattern.

Use the pattern. Simplify. ⓓ ((5x−6)(6x+5))

This product does not fit the patterns, so we will use FOIL.

(egin{array} {ll} {} &{(5x−6)(6x+5)} { ext{Use FOIL.}} & {30x^2+25x−36x−30} { ext{Simplify.}} & {30x^2−11x−30} end{array})

Example (PageIndex{29})

Choose the appropriate pattern and use it to find the product:

ⓐ ((9b−2)(2b+9)) ⓑ ((9p−4)^2) ⓒ ((7y+1)^2) ⓓ ((4r−3)(4r+3)).

**Answer**ⓐFOIL; (18b^2+77b−18)

ⓑ Binomial Squares; (81p^2−72p+16)

ⓒ Binomial Squares; (49y^2+14y+1)

ⓓ Product of Conjugates; (16r^2−9)

Example (PageIndex{30})

Choose the appropriate pattern and use it to find the product:

ⓐ ((6x+7)^2) ⓑ ((3x−4)(3x+4)) ⓒ ((2x−5)(5x−2)) ⓓ ((6n−1)^2).

**Answer**ⓐ Binomial Squares; (36x^2+84x+49) ⓑ Product of Conjugates; (9x^2−16) ⓒ FOIL; (10x^2−29x+10) ⓓ Binomial Squares; (36n^2−12n+1)

## Multiply Polynomial Functions

Just as polynomials can be multiplied, polynomial functions can also be multiplied.

MULTIPLICATION OF POLYNOMIAL FUNCTIONS

For functions (f(x)) and (g(x)),

[(f·g)(x)=f(x)·g(x)]

Example (PageIndex{31})

For functions *f(x)=x+2) and (g(x)=x^2−3x−4), find:

- ((f·g)(x))
- ((f·g)(2)).

**Answer**ⓐ

(egin{array} {ll} {} &{(f·g)(x)=f(x)·g(x)} { ext{Substitute for } f(x) ext{ and } g(x)} &{(f·g)(x)=(x+2)(x^2−3x−4)} { ext{Multiply the polynomials.}} &{(f·g)(x)=x(x^2−3x−4)+2(x^2−3x−4)} { ext{Distribute.}} &{(f·g)(x)=x3−3x^2−4x+2x^2−6x−8} { ext{Combine like terms.}} &{(f·g)(x)=x3−x^2−10x−8} end{array})

ⓑ In part ⓐ we found ((f·g)(x)) and now are asked to find ((f·g)(2)).

(egin{array} {ll} {} &{(f·g)(x)=x^3−x^2−10x−8} { ext{To find }(f·g)(2), ext{ substitute } x=2.} &{(f·g)(2)=2^3−2^2−10·2−8} {} &{(f·g)(2)=8−4−20−8} {} &{(f·g)(2)=−24} end{array})

Example (PageIndex{32})

For functions (f(x)=x−5) and (g(x)=x^2−2x+3), find

- ((f·g)(x))
- ((f·g)(2)).

**Answer a**((f·g)(x)=x^3−7x^2+13x−15)

**Answer b**((f·g)(2)=−9)

Example (PageIndex{33})

For functions (f(x)=x−7) and (g(x)=x^2+8x+4), find

- ((f·g)(x))
- ((f·g)(2)).

**Answer a**((f·g)(x)=x^3+x^2−52x−28)

**Answer a**((f·g)(2)=−120)

Access this online resource for additional instruction and practice with multiplying polynomials.

__Introduction to special products of binomials__

## Glossary

**conjugate pair**- A conjugate pair is two binomials of the form ((a−b)) and ((a+b)). The pair of binomials each have the same first term and the same last term, but one binomial is a sum and the other is a difference.

## Javascript

Time complexity of the above solution is O(mn). If size of two polynomials same, then time complexity is O(n 2 ).**Can we do better?**

There are methods to do multiplication faster than O(n 2 ) time. These methods are mainly based on divide and conquer. Following is one simple method that divides the given polynomial (of degree n) into two polynomials one containing lower degree terms(lower than n/2) and other containing higher degree terns (higher than or equal to n/2)

So the above divide and conquer approach requires 4 multiplications and O(n) time to add all 4 results. Therefore the time complexity is T(n) = 4T(n/2) + O(n). The solution of the recurrence is O(n 2 ) which is same as the above simple solution.

The idea is to reduce number of multiplications to 3 and make the recurrence as T(n) = 3T(n/2) + O(n) **How to reduce number of multiplications?**

This requires a little trick similar to Strassen’s Matrix Multiplication. We do following 3 multiplications.

**In Depth Explanation**

Conventional polynomial multiplication uses 4 coefficient multiplications:

However, notice the following relation:

The rest of the two components are exactly the middle coefficient for product of two polynomials. Therefore, the product can be computed as:

Hence, the latter expression has only three multiplications.

So the time taken by this algorithm is T(n) = 3T(n/2) + O(n)

The solution of above recurrence is O(n Lg3 ) which is better than O(n 2 )

.

We will soon be discussing implementation of above approach.

There is a O(nLogn) algorithm also that uses Fast Fourier Transform to multiply two polynomials (Refer this and this for details)**Sources:**

http://www.cse.ust.hk/

dekai/271/notes/L03/L03.pdf

This article is contributed by Harsh. Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

Attention reader! Don&rsquot stop learning now. Get hold of all the important DSA concepts with the **DSA Self Paced Course** at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer **Complete Interview Preparation Course****.**

## Multiplying a Monomial Times a Monomial

Before jumping into multiplying polynomials, let&aposs break it down into multiplying monomials. When you&aposre multiplying polynomials, you&aposll be taking it just two terms at a time, so getting monomials down is important.

Let&aposs start with:**(3)(2x)**

All you need to do here is break it down to 3 times 2 times x. You can get rid of the parenthesis and write it out like 3 · 2 · x. (Avoid using "x" to mean multiplication. It can get confusing with the letter x as a variable. Use · for multiplication instead!)

Because of the commutative property of multiplication, you can multiply the terms in any order, so let&aposs solve this by going from left to right:

3 · 2 · x

3 times 2 is 6, so we&aposre left with:

6 · x, which can be written as 6x.

## MathHelp.com

That is, foil tells you to multiply the first terms in each of the parentheses, then multiply the two terms that are on the "outside" (furthest from each other), then the two terms that are on the "inside" (closest to each other), and then the last terms in each of the parentheses. In other words, using the previous example:

#### Use foil to simplify (x + 3)(x + 2)

Okay the instructions specify the method I have to use, so here goes:

Adding the results of the four multiplications together, and combining the two "like" terms in the middle, I get:

Many instructors in later math classes come to hate " foil " because it often seems to serve mostly to confuse students when they reach more advanced material. Unfortunately, foil tends to be taught in earlier algebra courses as "the" way to multiply *all* polynomials, which is clearly not true. (As soon as either one of the polynomials has more than a "first" and "last" term in its parentheses, you're hosed if you try to use F foil , because those terms won't "fit".)

And foil is, essentially, just a means of keeping track of what you're doing when you're multiplying horizontally. But you already know that, for multiplications of larger numbers, vertical is the way to go. It's the same in algebra. When multiplying larger polynomials, just about everybody switches to vertical multiplication it's just so much easier to use.

If you want to use foil , that's fine, but (warning!) keep its restriction in mind: you can ONLY use it for the special case of multiplying two binomials. You can NOT use it at ANY other time!

#### Simplify (x &ndash 4)(x &ndash 3)

The instructions don't tell me what method I have to use for this multiplication, so I'll go vertical:

#### Multiply and simplify: (x &ndash 3y)(x + y)

This multiplication looks like it could be more complicated, because of the second variable, but the process doesn't care how many terms have variables. So I can proceed as usual.

Vertical multiplication gives me this:

#### Multiply and simplify: (2x &ndash 5)(3x + 4)

This multiplication has some slightly larger coefficients, but the process is the same. I'll work vertically:

I won't bother doing the foil process for this exercise.

#### Multiply: (&ndash4x &ndash 1)(5x &ndash 7)

The factors in this product have a lot of "minus" signs, but the process remains the same:

#### Expand: (x &ndash 3) 2

Some students will try to take a shortcut with this and, thinking that the power somehow "distributes" over the terms, they'll square each of the terms (getting an *x* 2 and a 9 , but no middle terms with *x* 's in them) and. then they'll be confused about what signs should go where.

Instead, I'm going to write out the square explicitly the expression they gave me means the following:

This multiplies as follows:

#### Expand and simplify:

Fractions? Really. Well, the process will work just the same with fractions as it did with whole numbers:

Off to the side on my scratch-paper, I add the fractions for the middle term:

So my simplified answer is:

Before we move on, please allow me reiterate what I said at the beginning of this page: " foil " works ONLY for the specific and special case of a two-term expression times another two-term expression. It does NOT apply in ANY other case. You should *not* rely on foil for general multiplication, and should not expect it to "work" for every multiplication, or even for most multiplications. If you only learn foil , you will *not* have learned all you need to know, and this *will* cause you problems later on down the road.

Yes, I'm ranting. But I have seen too many students be greatly hampered in their studies by an unthinking over-reliance on foil . Their instructors often never even taught them any method for multiplying other sorts of polynomials. For your own sake, take the time to read the next page and learn how to multiply general polynomials properly.

You can use the Mathway widget below to practice multiplying binomials. Try the entered exercise, or type in your own exercise. Then click the button and select "Multiply" or "Simplify" to compare your answer to Mathway's. (Or skip the widget, and continue with the lesson.)

*(Click "Tap to view steps" to be taken directly to the Mathway site for a paid upgrade.)*

## 2.5: Multiply Polynomials - Mathematics

**Multiplying Polynomials**

· Multiply monomials times polynomials.

· Multiply any two polynomials.

Multiplying **polynomials** involves applying the rules of exponents and the distributive property to simplify the product. This multiplication can also be illustrated with an area model, and can be useful in modeling real world situations. Understanding polynomial products is an important step in learning to solve algebraic equations involving polynomials.

**Multiplying Monomials**

Let's begin by multiplying two simple **monomials** together. Consider a rectangle whose length is 2*x* and whose width is 3*x.* To find the area of this rectangle, multiply the length by the width.

Area of rectangle = (2*x*)(3*x*) = (2*x*)(3*x*) = 2 • 3 • *x* • *x* = 6*x* 2

Note that the commutative and associative properties of multiplication are used to rearrange the factors, putting the coefficients together and the variables together.

The area, 6*x 2* , is a product that includes a coefficient (6) and a variable with a whole number exponent (*x* 2 ). In other words, it's a monomial, too. So the result of multiplying two monomials is—another monomial!

Let's try a slightly more complex problem: -9*x* 3 • 3*x* 2 .

**Multiply. -9 x 3 • 3x 2**

-9 • 3 • *x* 3 • *x* 2

Use commutative and associative properties of multiplication to rearrange the factors.

Multiply constants. Remember that a positive number times a negative number yields a negative number.

Multiply variable terms. Remember to add the exponents when multiplying exponents with the same base.

−9*x* 3 • 3*x* 2 = −27*x* 5

That’s it! When multiplying monomials, multiply the coefficients together, and then multiply the variables together. If two variables have the same base, follow the rules of exponents, like this:

Find the area of the rectangle:

Incorrect. Multiply the two coefficients to get 15, then multiply the variables. Use the rules of exponents: *y* 3 • *y* 2 = *y* 3 + 2 = *y* 5 . The correct answer is 15*y* 5 .

Correct. Multiply 3 • 5 and *y* 3 • *y* 2 , using the rules of exponents to get 15*y* 5 .

Incorrect. When you multiply with exponents, if the bases are the same, you add the exponents: *y* 3 • *y* 2 = *y* 3 + 2 = *y* 5 . The correct answer is 15*y* 5 .

Incorrect. You correctly multiplied the variables (*y* 3 • *y* 2 = *y* 3 + 2 = *y* 5 ) but you appear to have added the coefficients rather than multiplied. The correct answer is 15*y* 5 .

**The Product of a Monomial and a Polynomial**

The distributive property can be used to multiply a polynomial by a monomial. Just remember that the monomial must be multiplied by each term in the polynomial. Consider the expression 2*x*(2*x* 2 + 5*x* + 10).

This expression can be modeled with a sketch like the one below.

The model above illustrates the distributive property.

2*x*(2*x* 2 + 5*x* + 10) = 2x(2*x* 2 ) + 2x(5x) = 2x(10)

= 4*x* 3 + 10*x* 2 + 20*x*

**Simplify. 5 x(4x 2 + 3x + 7)**

5*x*(4*x* 2 ) + 5x(3*x*) + 5x(7)

Distribute the monomial to each term of the polynomial.

20*x* 3 + 15*x* 2 + 35*x*

5*x*(4*x* 2 + 3*x* + 7) = 20*x* 3 + 15*x* 2 + 35*x*

You may need to rewrite subtraction as adding the opposite.

**Simplify. 7 x 2 (2x 2 – 5x + 1)**

7*x* 2 [2*x* 2 + (– 5*x*) + 1]

Rewrite the subtraction as adding the opposite.

7*x* 2 (2*x* 2 ) + 7*x* 2 (– 5*x*) + 7x 2 (1)

Distribute the monomial to each term of the polynomial.

14*x* 4 + (-35)*x* 3 + 7*x* 2

7*x* 2 (2*x* 2 – 5*x* + 1) =

14*x* 4 – 35*x* 3 + 7*x* 2

Rewrite addition of terms with negative coefficients as subtraction.

Find the product. Watch the signs!

-3*t* 2 (7*t 3* + 3*t* 2 – *t*)

A) -21*t* 5 – 9*t* 4 + 3*t* 3

B) -21*t* 5 + 9*t* 4 – 3*t* 3

C) -21*t* 6 – 9*t* 4 + 3*t* 2

D) -21*t* 5 + 3*t* 2 – *t*

A) ) -21*t* 5 – 9*t* 4 + 3*t* 3

Correct. Rewriting the subtraction as adding the opposite gives -3*t* 2 [7*t* 3 + 3*t* 2 + (-*t*)]. Distributing the monomial -3*t* 2 gives -3*t* 2 • 7*t* 3 + (-3*t* 2 ) • 3*t* 2 + (-3*t* 2 ) • (-*t*), which is -21*t* 5 + (‑9*t* 4 ) + (3*t* 3 ). Rewriting addition of terms with negative coefficients as subtraction gives ‑21*t* 5 – 9*t* 4 + 3*t* 3 .

B) -21*t* 5 + 9*t* 4 – 3*t* 3

Incorrect. The negative must be distributed to all terms along with the 3*t* 2 . This changes the sign of the middle and last terms. The correct answer is ‑21*t* 5 – 9*t* 4 + 3*t* 3 .

C) -21*t* 6 – 9*t* 4 + 3*t* 2

Incorrect. By the laws of exponents, you add (not multiply) exponents when multiplying: -3*t* 2 • 7*t* 3 + (-3*t* 2 ) • 3*t* 2 + (-3*t* 2 ) • (-*t*) is -21*t* 5 + (-9*t* 4 ) + (3*t* 3 ). The correct answer is ‑21*t* 5 – 9*t* 4 + 3*t* 3 .

D) -21*t* 5 + 3*t* 2 – *t*

Incorrect. You must distribute the monomial to all three terms in the polynomial, not just the first one: -3*t* 2 • 7*t* 3 + (-3*t* 2 ) • 3*t* 2 + (-3*t* 2 ) • (-*t*). The correct answer is ‑21*t* 5 – 9*t* 4 + 3*t* 3 .

**Product of Two Binomials**

Now let's explore multiplying two binomials. Once again, you can draw an area model to help make sense of the process. You'll use each binomial as one of the dimensions of a rectangle, and their product as the area.

## Polynomials

&emsp&emspIn the symbol a^n,a is called Hie base and n is called the exponent. The term a^2 is read &ldquo a square,&rdquo a^3 is read &ldquo a cubed,&rdquo a^4 is read " a to the fourth power," and in general a^n is read &ldquo a to the n th power.&rdquo

&emsp&emspA variable is a letter that takes on dmerent values from a given collection of real numbers during a given discussion. A constant is a symbol or letter that stands for just one particular real number during the discussion, even if we do not specify which real number it stands for. It is an agreed custom to use the ﬁrst letters of the alphabet, such as a, b, c, d, . , for constants and the latter letters of the alphabet. such as x, y, z, u, v, . , for variables. Since there are only a ﬁnite number of letters in the alphabet we are sometimes forced to use subscripts on a single letter to distinguish between different constants. For example, a_0 is read &ldquo a -sub-nought" or &ldquo a -sub-zero," a , is read " a - sub-one,&rdquo and, in general, for n a positive integer a_n , is read &ldquo a -sub- n .&rdquo We certainly must not confuse subscripts with exponents.

&emsp&emspBy a monomial in the variables x, y, . , z , we mean an expression

of the form

&emsp&emspwhere n, m, . p are positive integers. For example, 7x^3y^2z^5 is a monomial in the variables x, y , and z . Constants are also referred to as monomials. A polynomial in the variables x, y. z is any sum of monomials in x, y. z . In particular, a binomial is the sum of two monomials and a trinomial is the sum of three monomials. A monomial appearing in a polynomial is referred to as a term of the polynomial.

&emsp&emspBy the degree of a monomial we shall mean the sum of the exponents of the variables, or if the monomial is a nonzero constant its degree is understood to be 0 . Thus, the monomial 5 is of degree zero, 3x is of degree one, while 7x^3y^2z^5 is of degree ten. No degree is assigned to the monomial 0 . Furthermore, while the term 7x^3y^2z^5 is of degree ten, it is also of degree three in x , two in y , and live in z . By the degree of a polynomial, we shall mean the degree of the monomial of highest degree appearing in the polynomial. Polynomials of degree one, two, or three often are called linear, quadratic, or cubic polynomials respectively.

**Example 1.** Find the degree, the degree in x , and the degree in y of the polynomial 7x^2y^3-4xy^2-x^3y+9y^4 .

The terms of the polynomial are the monomials 7x^2y^3,-4xy^2-x^3y , and 9y^4 .

Degree in x | Degree in y | Degree | |

7x^2y^3 | 2 | 3 | 5 |

-4xy^2 | 1 | 2 | 3 |

-x^3y | 3 | 1 | 4 |

9y^4 | 0 | 4 | 4 |

&emsp&emspConsequently the degree of the polynomial in x is 3 , the degree in y is 4 , and its degree is 5 , as indicated in the table above.&emsp&emsp

&emsp&emspAny collection of factors in a given monomial is called the coefficient of the remaining factors in the monomial. Thus in the monomial 3xy, 3 is the coefficient of xy , while 3y is the coefficient of x . The numerical factor of a monomial is referred to as the numerical coefficient or simply the coeiﬁcienl of the monomial. For example, 3 is the coefficient of 3x^2y, 1 is the coeﬁicient of x^2y^3 , while -1 is the coefficient of -x

&emsp&emspThe leading coefficient of a. polynomial in a single variable is the coefficient of the term of highest degree. The constant term is the term with no variable factor. If we write the polynomial in descending powers of x , as

&emsp&emspthen the polynomial is of degree n , has leading coefficient a_n , and constant term a_0 .

**Example 2.** What is the degree, leading coefficient, and constant term of each of the following?

Degree | &emsp&emspLanding Cofficient | &emsp&emspConstant Term | |

3x^2-2x+1 | 2 | 3 | 1 |

7x-4x^3+3 | 3 | -4 | 3 |

2x-4x^2-x^5 | 5 | -1 | 0 |

5 | 0 | 5 | 5 |

&emsp&emspThe value of a polynomial in the variable x at the real number x = a is the real number obtained by replacing each occurrence of x in the polynomial by a. For example, the value of 2x^2- x + 7 at x = -3 is

&emsp&emspThe value of a polynomial in two or more variables is obtained in a similar way. We obtain the value of xy-x^2+ y^3 at x = 1 , y = -2 by replacing each x with 1 and each y with -2 :

&emsp&emspThus the value of xy-x^2+y^3 at x=1 , y=-2 is -11 .

**2.2&emsp&emspAddition and Subtraction of Polynomials**

&emsp&emspSince polynomials are expressions in one or more variables over the real numbers, the laws that we discussed in Chapter 1 may be used to develop techniques for adding, subtracting, multiplying, and dividing them.

&emsp&emspThe addition of two expressions, such as 2a and 4a , may be accomplished by a direct application of the distributive law. Thus,

&emsp&emspAn expression of the form 2x + 3y cannot be put in any simpler form since in general x and y will denote two different quantities. We can, however, add two or more expressions of this kind in the following way.

**Example 1.&emsp&emsp**Add 2a+3b-4c and 6a-5b+2c .

&emsp&emspUsing the associative and commutative laws for addition as well as the distributive law we have

&emsp&emspIn practice, when several expressions are to be added, the following method is sometimes helpful.

**&emsp&emsp**Add 3a-4ab^3+7c^3 , 7ab-4a+5c^3 , 2ab^2-4a+8c^3 , and -5a+4ab-2ab^2+3c^3 .

&emsp&emspWe write the expressions directly underneath one another in such a way that the terms containing the same letters appear in the same column as follows:

&emsp&emsp&emsp&emsp

&emsp&emspThe bottom line is the ﬁnal result, which is obtained by adding the respective columns.

&emsp&emspWe have already seen (Chapter 1) that subtraction of signed numbers may be accomplished by addition after changing the sign of the number to be subtracted. This is exactly what we do when we subtract polynomials.

**&emsp&emsp**Subtract 3x-2s+t from 4x+s-2t

**&emsp&emsp**From the sum of 2a + 7b - 15c and 60 - 4b + c subtract the sum of a-b+2c and -2a+6b-3c .

&emsp&emspSince subtracting the sum of a - b + 2c and - -2a+6b-3c is the same as subtracting each expression separately, we simply change all the signs of the last two expressions and add.

&emsp&emsp

&emsp&emspWe handle grouping with parentheses the same way that we handled it with signed numbers in Section 1.2.

Let&rsquos see how our Polynomials solver simplifies this and similar problems. Click on "Solve Similar" button to see more examples.

**&emsp&emsp**Rewrite the expression x-2y+ z-5 with the last three terms enclosed in parentheses preceded by a minus sign.

**2.3&emsp&emspMultiplication of Polynomials**

**&emsp&emsp**When multiplying monomials in which the variable x appears, we obtain products of the form x^(m)x^(n) . The total number of factors of x in this product is m + n , so that we have the following law of exponents:

&emsp&emspIn order to multiply two or more algebraic expressions together we must make use of the above law as well as the laws of real numbers from Chapter 1.

&emsp&emspIn particular we make use of the distributive laws when we multiply two multinomials, as is illustrated in the following examples.

**&emsp&emsp**Multiply (x^3+2x^2-x+2) by (2x)

**&emsp&emsp**Multiply 3x^2+x-5 by x+2 .

&emsp&emspFrom Example 3 we see that the terms in the product of one polynomial by another are obtained by multiplying each term in the ﬁrst factor by each term in the second. With a little experience we will be able to skip the steps that use the distributive laws, simply writing down all the products. This is illustrated in the next two examples.

Let&rsquos see how our polynomial solver Multiplies this and similar problems. Click on "Solve Similar" button to see more examples.

**&emsp&emsp**Multiply 2x+3 by x-5

**&emsp&emsp**Multiply 2x+y by x+2y-3 .

**2.4&emsp&emspDivision of Polynomials**

&emsp&emspIn order to divide one polynomial by another, we ﬁrst must be able to divide one monomial by another. When dividing one monomial in at by another we must consider expressions of the form x^(m)÷x^(n) where m > n . This quotient is x^(m-n) since x^(m-n)x^n=x^m . Also if m = n , then x^m÷x^n = 1 . This can be summarized as another law of exponents:

&emsp&emsp

**&emsp&emsp**Divide 8x^4y^2z^3 by 2x^2yz .

&emsp&emspWe use the notation of long division, which is what we will ﬁnd convenient for dividing one polynomial by another.

&emsp&emsp

&emsp&emspThe next example recalls the method of long division for integers.

**&emsp&emsp**Divide 492 by 8 .

&emsp&emsp

&emsp&emspThis gives us the equality

&emsp&emspRecall that 492 is called the dividend, 8 the divisor, 61 the quotient, and 4 the remainder. Note the division process terminates when the remainder is less than the divisor.

&emsp&emspThe division of one polynomial by another is carried out in a similar manner. Here the division terminates when the degree of the remainder is less than the degree of the divisor, or when the remainder is zero.

**&emsp&emsp**Divide -3x+2x^2+5 by x-1 .

**Step 1.&emsp&emsp**Arrange both polynomials in descending powers of x , and write as follows.

&emsp&emsp

**Step 2.&emsp&emsp**Divide x into 2x^2 .

&emsp&emsp

**Step 3.&emsp&emsp**Multiply x-1 by 2x and subtract from 2x^2-3x+5 .

&emsp&emsp

&emsp&emspSince the degree of the remainder, -x+5 , is not less than the degree of the divisor, x-1 , we repeat the process.

**Step 4.&emsp&emsp**Divide x into -x .

&emsp&emsp

**Step 5.&emsp&emsp**Multiply x-1 by -1 and subtract from -x+5 .

&emsp&emsp

&emsp&emspThe remainder, 4 , has degree 0 , and Hie divisor, x- 1 , has degree 1 Therefore, the division terminates.

**Step 6.&emsp&emsp**The result of this division is presented by the equation

**&emsp&emsp**Divide 3x^3-2x+5 by x^2+x+1 .

&emsp&emsp

&emsp&emspSince the degree of the remainder, -2x+8 , is less than the degree of the divisor, x^2+x + 1 , the process terminates. The result is

**&emsp&emsp**Divide 3x^3+2x^2-1 by 2x+7 .

&emsp&emsp

**&emsp&emsp**Divide x^3+a^3 by x-a

&emsp&emspTo perform this division we treat these polynomials as polynomials in the single variable x .

&emsp&emsp

## Factoring Polynomials: Common Factors

Let's look at this in more details: Notice that there was an in both terms of the original. When we reversed the distribution, **we put the common factor on the outside of the parenthesis and wrote in parenthesis everything that was left.**

Let's look for common factors in the following polynomials and factor them out:

**1) 3x + 3y.**The common factor in this one is pretty obvious. Do you see it?

Of course 3 is our common factor because it is in both terms.

We write out common factor (3) on the outside of the parenthesis

We can check our answer by distributing. :3(x + y) = 3x + 3y (the original problem) so we know we are correct.

**2) 5x + 2xy.** Do you see the common factor(s)?

Of course x is our common factor because it is in both terms.

We write out common factor (x) on the outside of the parenthesis and everything else inside parenthesis.

Final answer x(5 + 2y)

We can check our answer by distributing. : x(5 + 2y) = 5x + 2xy (the original

**3) 6x + 12.** The common factor isn't as obvious in this one, so we will factor first.

We can see that 3 is our common factor because it is in both terms.

We write out common factor (3) on the outside of the parenthesis and everything else inside parenthesis, recombining the leftover factors (2 . x = 2x)

We can check our answer by distributing. : 3(2x + 4) = 6x + 12 (the original

**4)5x 2 +10x**. The common factor isn't as obvious in this one, so we will factor first.

We can see that both 5 and x are our common factors

We write out common factors (5x) on the outside of the parenthesis and everything else inside parenthesis.

We can check our answer by distributing. : (the original

**5) 7x + 7.** The common factor is pretty obvious here.

Of course 7 is our common factor because it is in both terms.

We write out common factor (7) on the outside of the parenthesis. **Notice that when all the factors are removed from a term, there is still an understood 1.** Remember that factoring is reversing multiplication. We need to be able to multiply 7(x + 1) and get back to our original answer. Without the 1,we would not get back to 7x + 7

We can check our answer by distributing. : 7(x + 1) = 7x + 7 (the original

**6)** The common factor isn't perfectly clear, so we will factor first.

The only factor that is in all three terms is 2.x is not a common factor because it is not in the last term.

We write out common factor (2) on the outside of the parenthesis and everything else inside parenthesis, recombining the leftover factors.

Final answer:

We can check our answer by distributing. : (the original

## PRODUCTS OF POLYNOMIALS

### OBJECTIVES

- Find the product of two binomials.
- Use the distributive property to multiply any two polynomials.

In the previous section you learned that the product A(2x + y) expands to A(2x) + A(y).

Now consider the product (3x + z)(2x + y).

Since (3x + z) is in parentheses, we can treat it as a single factor and expand (3x + z)(2x + y) in the same manner as A(2x + y). This gives us

If we now expand each of these terms, we have

Notice that in the final answer each term of one parentheses is multiplied by every term of the other parentheses.

Note that this is an application of the distributive property. |

Note that this is an application of the distributive property. |

Since - 8x and 15x are similar terms, we may combine them to obtain 7x.

In this example we were able to combine two of the terms to simplify the final answer.

Here again we combined some terms to simplify the final answer. Note that the order of terms in the final answer does not affect the correctness of the solution.

## Open Resources for Community College Algebra

Previously in Section 5.2, we learned to multiply two monomials together (such as (4xycdot3x^2)). And in Section 5.1, we learned how to add and subtract polynomials even when there is more than one term (such as ((4x^2-3x)+(5x^2+x-2))). In this section, we will learn how to multiply polynomials with more than one term.

Figure 5.4.1. Alternative Video Lesson

###### Example 5.4.2 . Revenue.

Avery owns a local organic jam company that currently sells about (1500) jars a month at a price of ($13) per jar. Avery has found that for each time they would raise the price of a jar by (25) cents, they will sell (50) fewer jars of jam per month.

In general, this company's revenue can be calculated by multiplying the cost per jar by the total number of jars of jam sold. If we let (x) represent the number of times the price was raised by (25) cents, then the price will be (13+0.25x ext<.>)

Conversely, the number of jars the company will sell will be the (1500) they currently sell each month, minus (50) times (x ext<.>) This gives us the expression (1500-50x) to represent how many jars the company will sell after raising the price (x) times.

Combining these expressions, we can write a formula for the revenue model:

To simplify the expression (left(13+0.25x ight)left(1500-50x ight) ext<,>) we'll need to multiply (13+0.25x) by (1500-50x ext<.>) In this section, we learn how to do that.

### Subsection 5.4.1 Review of the Distributive Property

Polynomial multiplication relies on the distributive property , and may also rely on the rules of exponents. When we multiply a monomial with a binomial, we apply this property by distributing the monomial to each term in the binomial. For example,

###### Remark 5.4.3 .

We can use the distributive property when multiplying on either the left or the right. This means that (a(b+c)=ab+ac ext<,>) but also ((b+c)a=ba+ca ext<.>)

###### Example 5.4.4 .

A rectangle's length is (4) meters longer than its width. Assume its width is (w) meters. Use a simplified polynomial to model the rectangle's area in terms of (w) as the only variable.

Since the rectangle's length is (4) meters longer than its width, we can model its length by (w+4) meters.

The rectangle's area would be:

The rectangle's area can be modeled by (w^2+4w) square meters.

In the second line of work above, we should recognize that ((w+4)w) is equivalent to (w(w+4) ext<.>) Whether the (w) is written before or after the binomial, we are still able to use distribution to simplify the product.

###### Checkpoint 5.4.5 .

The distributive property can be understood visually with a .

The big rectangle consists of two smaller rectangles. The big rectangle's area is (2x(3x+4) ext<,>) and the sum of those two smaller rectangles is (2xcdot3x+2xcdot4 ext<.>) Since the sum of the areas of those two smaller rectangles is the same as the bigger rectangle's area, we have:

Generic rectangles can be used to visualize multiplying polynomials.

### Subsection 5.4.2 Multiplying Binomials

##### Multiplying Binomials Using Distribution.

Whether we're multiplying a monomial with a polynomial or two larger polynomials together, the first step is still based on the distributive property . We'll start with multiplying two binomials and then move on to larger polynomials.

We know we can distribute the (3) in ((x+2)3) to obtain ((x+2)multiplyright<3>=xmultiplyright<3>+2multiplyright<3> ext<.>) We can actually distribute *anything* across ((x+2)) if it is multiplied. For example:

With this in mind, we can multiply ((x+2)(x+3)) by distributing the ((x+3)) across ((x+2) ext<:>)

To finish multiplying, we'll continue by distributing again, but this time across ((x+3) ext<:>)

To multiply a binomial by another binomial, we simply had to repeat the step of distribution and simplify the resulting terms. In fact, multiplying any two polynomials will rely upon these same steps.

##### Multiplying Binomials Using FOIL .

While multiplying two binomials requires two applications of the distributive property, people often remember this distribution process using the acronym FOIL . FOIL refers to the pairs of terms from each binomial that end up distributed to each other.

If we take another look at the example we just completed, ((x+2)(x+3) ext<,>) we can highlight how the FOIL process works. FOIL is the acronym for “First, Outer, Inner, Last”.

The (x^2) term was the result of the product of *first* terms from each binomial.

The (3x) was the result of the product of the *outer* terms from each binomial. This was from the (x) in the front of the first binomial and the (3) in the back of the second binomial.

The (2x) was the result of the product of the *inner* terms from each binomial. This was from the (2) in the back of the first binomial and the (x) in the front of the second binomial.

The constant term (6) was the result of the product of the *last* terms of each binomial.

##### Multiplying Binomials Using Generic Rectangles.

We can also approach this same example using the generic rectangle method. To use generic rectangles, we treat (x+2) as the base of a rectangle, and (x+3) as the height. Their product, ((x+2)(x+3) ext<,>) represents the rectangle's area. The next diagram shows how to set up generic rectangles to multiply ((x+2)(x+3) ext<.>)

The big rectangle consists of four smaller rectangles. We will find each small rectangle's area in the next diagram by the formula ( ext= ext

To finish finding this product, we need to add the areas of the four smaller rectangles:

Notice that the areas of the four smaller rectangles are exactly the same as the four terms we obtained using distribution, which are also the same four terms that came from the FOIL method. Both the FOIL method and generic rectangles approach are different ways to represent the distribution that is occurring.

###### Example 5.4.10 .

Multiply ((2x-3y)(4x-5y)) using distribution.

To use the distributive property to multiply those two binomials, we'll first distribute the second binomial across ((2x-3y) ext<.>) Then we'll distribute again, and simplify the terms that result.

###### Example 5.4.11 .

First, Outer, Inner, Last: Either with arrows on paper or mentally in our heads, we'll pair up the four pairs of monomials and multiply those pairs together.

###### Example 5.4.12 .

Multiply ((2x-3y)(4x-5y)) using generic rectangles.

We begin by drawing four rectangles and marking their bases and heights with terms in the given binomials:

Next, we calculate each rectangle's area by multiplying its base with its height:

Finally, we add up all rectangles' area to find the product:

###### Example 5.4.15 .

Multiply and simplify the formula for Avery's organic jam revenue, (R) (in dollars), from Example 5.4.2 where (R= (13+0.25x)(1500-50x)) and (x) represents the number of times they raised the price by 25 cents.

To multiply this, we'll use FOIL :

###### Example 5.4.16 .

Tyrone is an artist and he sells each of his paintings for ($200 ext<.>) Currently, he can sell (100) paintings per year. So his annual revenue from selling paintings is ($200cdot100=$20000 ext<.>) He plans to raise the price. However, for each $20 price increase per painting, his customers will buy (5) fewer paintings annually.

Assume Tyrone would raise the price of his paintings (x) times, each time by $20. Use an expanded polynomial to represent his new revenue per year.

Currently, each painting costs $200. After raising the price (x) times, each time by $20, each painting's new price would be (200+20x) dollars.

Currently, Tyrone sells (100) paintings per year. After raising the price (x) times, each time selling (5) fewer paintings, he would sell (100-5x) paintings per year.

His annual revenue can be calculated by multiplying each painting's price by the number of paintings he would sell:

After raising the price (x) times, each time by $20, Tyrone's annual income from paintings would be (-100x^2+1000x+20000) dollars.

### Subsection 5.4.3 Multiplying Polynomials Larger Than Binomials

The foundation for multiplying any pair of polynomials is distribution and monomial multiplication. Whether we are working with binomials, trinomials, or larger polynomials, the process is fundamentally the same.

###### Example 5.4.17 .

Multiply (left( x+5 ight)left( x^2-4x+6 ight) ext<.>)

We can approach this product using either distribution generic rectangles. We cannot directly use the FOIL method, although it can be helpful to draw arrows to the six pairs of products that will occur.

Using the distributive property, we begin by distributing across (left( x^2-4x+6 ight) ext<,>) perform a second step of distribution, and then combine like terms.

With the foundation of monomial multiplication and understanding how distribution applies in this context, we are able to find the product of any two polynomials.

###### Checkpoint 5.4.19 .

### Reading Questions 5.4.4 Reading Questions

Describe three ways you can go about multiplying ((x+3)(2x+5) ext<.>)

If you multiplied out ((a+b+c)(d+e+f+g) ext<,>) how many terms would there be? (Try to answer without actually writing them all down.)

## C++ Programming – Multiply two polynomials

Given two polynomials represented by two arrays, write a function that multiplies given two polynomials.

A simple solution is to one by one consider every term of first polynomial and multiply it with every term of second polynomial. Following is algorithm of this simple method.

The following is C++ implementation of above algorithm.

First polynomial is

5 + 0x^1 + 10x^2 + 6x^3

Second polynomial is

1 + 2x^1 + 4x^2

Product polynomial is

5 + 10x^1 + 30x^2 + 26x^3 + 52x^4 + 24x^5

Time complexity of the above solution is O(mn). If size of two polynomials same, then time complexity is O(n2).

Can we do better?

There are methods to do multiplication faster than O(n2) time. These methods are mainly based on divide and conquer. Following is one simple method that divides the given polynomial (of degree n) into two polynomials one containing lower degree terms(lower than n/2) and other containing higher degree terns (higher than or equal to n/2)

Let the two given polynomials be A and B.

For simplicity, Let us assume that the given two polynomials are of

same degree and have degree in powers of 2, i.e., n = 2i

The polynomial ‘A’ can be written as A0 + A1*xn/2

The polynomial ‘B’ can be written as B0 + B1*xn/2

For example 1 + 10x + 6ࡨ – 4ࡩ + 5ࡪ can be

written as (1 + 10x) + (6 – 4x + 5ࡨ)*x2

A * B = (A0 + A1*xn/2) * (B0 + B1*xn/2)

= A0*B0 + A0*B1*xn/2 + A1*B0*xn/2 + A1*B1*xn

= A0*B0 + (A0*B1 + A1*B0)xn/2 + A1*B1*xn

So the above divide and conquer approach requires 4 multiplications and O(n) time to add all 4 results. Therefore the time complexity is T(n) = 4T(n/2) + O(n). The solution of the recurrence is O(n2) which is same as the above simple solution.

The idea is to reduce number of multiplications to 3 and make the recurrence as T(n) = 3T(n/2) + O(n)

How to reduce number of multiplications?

This requires a little trick similar to Strassen’s Matrix Multiplication. We do following 3 multiplications.

X = (A0 + A1)*(B0 + B1) // First Multiplication

Y = A0B0 // Second

Z = A1B1 // Third

The missing middle term in above multiplication equation A0*B0 + (A0*B1 +

A1*B0)xn/2 + A1*B1*xn can obtained using below.

A0B1 + A1B0 = X – Y – Z

So the time taken by this algorithm is T(n) = 3T(n/2) + O(n)

The solution of above recurrence is O(nLg3) which is better than O(n2).