High School Modules > Algebra by Gregory A. Moore
Multiplying Polynomials
Exploring the methods of multiplying two polynomials together - FOIL method, special case multiplication formulas, a more general method for multiplying arbitrary polynomials, and higher powers of binomials..
[Directions : Execute the Code Resource section first. Although there will be no output immediately, these definitions are used later in this worksheet.]
0. Code
| > | restart; with(plots): |
Warning, the name changecoords has been redefined
| > | MultPoly := proc( poly1, poly2 ) # a = quanity of a, ar = a's rate, and so forth for b local p1, p2, n1, n2,A, B,R, C,i,j,k ; p1 := sort( poly1, x); p2 := sort( poly2, x); n1 := nops(p1); n2 := nops(p2); R := array([ seq( op(j-1, p1), j = 1..n1+1) ]); R[1] := 1; C := array([ seq( op(j-1, p2), j = 1..n2+1) ]); C[1] := 1; A := array( [seq( [ seq(C[k]*R[j] , j = 1..n1+1) ], k = 1..n2+1)]); A[1,1] := ` `; B := array( [seq( [ seq( ` ` , j = 1..(n1+2) ) ], k = 1..(n2+2) )]); for j from 1 to n1 do B[1, j+2] := A[1,j+1]; od; for i from 1 to n2 do B[i+2, 1] := A[i+1,1]; od; for j from 1 to n1 do B[2, j+2] := `__`; od; for i from 1 to n2 do B[i+2, 2] := `|`; od; for i from 1 to n2 do for j from 1 to n1 do B[i+2,j+2] := A[i+1,j+1]; od;od; print(B); print(` `); print(p1*p2 = sort( expand( poly1*poly2), x )); end proc: |
| > | FOIL := proc( poly1, poly2 ) local p1, p2, n1, n2,A, B,R, C,i,j,k, term ; p1 := sort( poly1, x); p2 := sort( poly2, x); n1 := nops(p1); n2 := nops(p2); if( (n1 = 2 ) and (n2 = 2) ) then term := sort( expand( op(1,p1)*op(1,p2), x )); print(cat(`F (1st x 1st) `,(op(1,p1)),`*`,op(1,p2),` = `),term); term := sort( expand( op(1,p1)*op(2,p2), x )); print(cat(`O (outer pair) `,(op(1,p1)),`*`,op(2,p2),` = `),term); term := sort( expand( op(2,p1)*op(1,p2), x )); print(cat(`I (inner pair) `,(op(2,p1)),`*`,op(1,p2),` = `),term); term := sort( expand( op(2,p1)*op(2,p2), x )); print(cat(`L (last x last) `,(op(2,p1)),`*`,op(2,p2),` = `),term); print(` `); print(p1*p2 = sort( expand( poly1*poly2), x )); else print(`Sorry,..., FOIL only works for a product of binomails`); fi; end proc: |
| > |
| > |
| > |
1. The Product of Two Binomials - Foil
To multiply two binomials, we need to use the "FOIL Method". We multiply :
F : first x first,
O : Outer pair (first time last)
I : Inner pair (last x first)
L : Last x Last
Usually the OI terms will combine since they are like terms, and result will be a trinomials (three terms).
| > | FOIL( x + 2, x + 9); |
| > | FOIL( x + 9, x - 13); |
| > | FOIL( x - 22, x + 18); |
| > | FOIL( x - 36, x + 48 ); |
| > | FOIL( 7*x + 16, 14*x + 24 ); |
Here is a formula version of the FOIL method. However, its easier to just understand the principle.
| > | FOIL( a*x + b, c*x + d); |
Notice that we can multiply two polynomials in a table format too. We put the terms of one binomial as row headings and the terms of the other binomial as the column headings, then complete the multiplication table, and combine the like terms.
| > | MultPoly( x + 2, 3*x + 9); |
| > | MultPoly( 100*x + 8, 120*x + 9); |
| > | MultPoly( 16*x + 27, 32*x + 9); |
| > | MultPoly( .01*x + 2, .03*x + .05); |
2. The Product of Two Binomials - Special Cases
There are two special cases which have their own formulas. We usually use these formula INSTEAD of the FOIL method.
First there is the
Difference of Squares
, or
Product of Conjugate Terms
. This occurs when we multiply a binomial times another binomial which is almost the same except the interior sign is opposite.
| > | FOIL( x + 2, x - 2 ); |
We see that the O and I are equal but opposite. When we combine like terms, they would cancel out. The final answer only has two terms, instead of three. Lets try another example.
| > | FOIL( 11*x + 13 , 11*x - 13); |
Aha! It happened again. Lets see if there is a formula.
| > | FOIL( x- b, x + b); |
| > | FOIL( a*x - b, a*x + b ); |
So we can refer to this formula for doing this kind of problem. First term squared minus last terms squared. Its just that simple, but it only works if the two terms are exact conjugates.
| > | (a*x - b)*(a*x + b): % = expand(%); |
| > | (3*x - 5)*(3*x + 5): % = expand(%); |
| > | (80*x - 66)*(80*x + 66): % = expand(%); |
Another special case is the
Perfect Square
of a Binomial
. This is when a single binomial is squared.
| > | FOIL( x + 5, x + 5); |
| > | MultPoly( 19*x - 3, 19*x - 3); |
Note that the O (outer pair) and I (inner pair) terms are equal. When we combine like terms, that term gets doubled. Lets get a formula for this.
| > | MultPoly( a*x + b, a*x + b); |
It appears that you square the first and last terms, then double the product of the terms.
| > | MultPoly( 3*x + 4, 3*x + 4); |
| > | MultPoly( 100*x - 8, 100*x - 8); |
Note the difference between a negative constant term and a positive constant. The only difference in the final result is that the sign of the middle term is the same as the sign of the binomial constant term.
| > | ( 2*x - 5)*(2*x - 5): % = expand(%); ( 2*x + 5)*(2*x + 5): % = expand(%); |
| > | ( 37*x - 17)*(37*x - 17): % = expand(%); ( 37*x + 17)*(37*x + 17): % = expand(%); |
| > | ( 1072*x - 232)*(1072*x - 232): % = expand(%); ( 1072*x + 232)*(1072*x + 232): % = expand(%); |
3. The Product of Two Arbitrary Polynomials
While the FOIL method only works on two binomails, we can still form a table to multiply two polynomials. Just as before, we write each term of the one polynomial at the left and the other terms on top. Each term has its own row or column. We simply multiply all the terms like a multiplication table and combine like terms to get the answer.
| > | MultPoly( 6*x + 5, 2*x + 11); |
| > | MultPoly( x^2 + 7*x + 2, 3*x - 8); |
| > | MultPoly( x + 2, x^2 + 3*x + 9); |
| > | MultPoly( x^2 +7*x - 13, 5*x^2 + 6*x + 4); |
| > | MultPoly( x^3 -10*x^2 + 11*x - 9, 10*x^2 + 17*x + 11); |
| > | MultPoly( x^3 - 13*x^2 + 6*x + 4, x^3 -8*x^2 - 6*x + 3); |
| > | MultPoly( x^4 + 2*x^3 - 4*x^2 + 8*x - 16, x - 1); |
Here is an interesting case.
| > | MultPoly( x^4 + x^3 + x^2 + x + 1, x - 1); |
Here is another.
| > | MultPoly( x^4 - x^3 + x^2 - x + 1, x + 1); |
4. Higher Powers of Binomials
We can also find higher powers of binomials. If we square a binomial, then multiply its output by the binomial again, we get the cube.
| > | A := 2*x + 3; MultPoly( A, A); MultPoly( A, A^2); A^3: % = expand(%); |
| > | A := 8*x - 7; MultPoly( A, A); MultPoly( A, A^2); A^3: % = expand(%); |
| > | A := 44*x + 63; MultPoly( A, A); MultPoly( A, A^2); A^3: % = expand(%); |
We can also compute 4th powers in a similar way.
| > | A := x + 5; MultPoly( A, A); MultPoly( A^2, A^2); A^4: % = expand(%); |
| > | A := 3*x + 7; MultPoly( A, A); MultPoly( A^2, A^2); A^4: % = expand(%); |
We can also compute higher powers in the same way. For example
| > | A := x + 3; MultPoly( A, A); MultPoly( A^2, A^2); MultPoly( A^4, A); |
| > | A := x - 1; MultPoly( A, A); MultPoly( A^2, A^2); MultPoly( A^4, A^4); |
| > |
| > |
© 2002 Waterloo Maple Inc