High School Modules > Algebra by Gregory A. Moore
Factoring Polynomials
Factoring polynomials can be one of the more difficult topics in algebra. There are various methods, and ultimately people internalize a method based on their understanding of how it works. In this worksheet, we will see how to factor polynomails in Maple, and then explore a chart method of examining all of the possible middle term coefficients.
[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; |
| > | FactorTable := proc( poly ) local p, lt,mt,ct, L, M, l,m, A,i,j,k,factorable; p := sort( poly, x); lt := coeff( p, x^2); mt := coeff( p, x); ct:= subs(x = 0, poly); print( `Leading term constant` = lt); print( `Constant term` = ct); print(` `); L := numtheory[divisors](lt); l := nops(L); M := numtheory[divisors](ct); m := nops(M); if( ct > 0) then l := ceil(l/2); fi; A := array([seq([seq(` ` , j = 1..m+3) ],i = 1..l+3)]): for i from 1 to l do A[i+3, 1] := L[i]; A[i+3, 2] := lt/L[i]; A[i+3, 3] := `|`; od: for j from 1 to m do A[1, j+3] := M[j]; A[2,j+3] := ct/M[j]; od: for j from 1 to m do A[3, j+3] := `__`; od: for i from 1 to l do for j from 1 to m do A[i+3, j+3] := A[1,j+3]*A[i+3,1] + A[2,j+3]*A[i+3,2] ; od:od: print(A); factorable := false; for i from 1 to l do for j from 1 to m do if(mt = A[i+3, j+3]) then factorable := true ; fi; od:od: print(` `); if(factorable) then print(`Factorable!`); else print(`Unfactorable`); fi; end proc: |
| > | FactorGrouping := proc( EQ ) local F, B, G, G1, G2; F := op(1, EQ) + op(2, EQ): B := op(3, EQ) + op(4, EQ): print(`\n1. Group the first two terms, and last two terms :`); print( EQ, `= (`,F,`) + (`,B,`)`); print(` `); G := gcd(factor(F), factor(B)); print(`\n2. These two groups are each divisible by `, G); G1 := simplify(F/G); G2 := simplify(B/G); print(EQ,cat( ` = `,G,`*`,G1,` + `,G,`*`,G2)); print(` `); print(`\n3. Factor this common term of `, G, ` out`); G1 := simplify(F/G); G2 := simplify(B/G); print(EQ,cat( ` = (`,convert(G,string) ,`)*(`,G1+G2,`)`)); end proc: |
| > |
1. Factoring Polynomials in Maple
Maple is just as capable of factoring polynomials as it is numbers.
| > | x^2 + 7*x + 12: % = factor( %); |
| > | 12*x^2 + 7*x + 1: % = factor( %); |
Note that NOT all polynomials are factorable. In this case, the simplest factorization is just the original polynomial - in the same way that the prime factorization of a 7 is simply 7.
| > | x^2 + 2*x + 3: % = factor( %); |
| > | 9*x^2 + 7*x + 11: % = factor( %); |
| > | 12*x^2 + 7*x + 1: % = factor( %); |
Also, some polynomials have factors common to all thier terms which can be factored out before the rest of the factoring continues.
| > | 32*x^2 - 162: % = factor( %); |
Here are some other examples
| > | 16*x^2+42*x+27: % = factor( %); |
| > | 36*x^2-105*x-50: % = factor( %); |
| > | 252*x^2+477*x+100: % = factor( %); |
| > | 252*x^2+477*x-100: % = factor( %); |
2. Chart Method
I created this method in the classroom. This method is a little more cumbersome than some of the book methods, but it is systematic, has the same series of steps each time, and has the advantage that it always gives an answer if an answer exists. And unlike the "multiply the first and last terms then factor by grouping" method, this chart method leads to a good understanding of what is going on - which can be eventually internalized.
The OI Chart : The way it works is the following :
1. Find every two-number factorization of the leading coefficient, and the constant term
2. Create a chart where each factorization of the leading coeffient has its own row along the left column,
and every factorization of the constant is in its own column along the top row.
(In this chart, the top two rows are the factorizations of the constant, and the left two rows are the
factorizations of the leading term).
3. We are going to create the OI's (Outer products and Inner products of the FOIL method). Multiply the first
number of a l.c. factorization by the first number of a constant term factorization. Then multiply second
by second. Then add them together and put that number in the chart - at the row and column which
align to the row and column of the two factorizations.
4. When the chart is complete, look in the body of the chart and see if you can find the middle term coefficient.
If you can find it, then the trinomial IS factorable. If you can't find it, then it's not factorable.
5. To find the factorization, trace the number in the body of the table to its row and column original
factorizations. Form the OI computation, and then form two binomials which have that Outer
pair product and Inner pair product. That is the factorization.
| > | FactorTable( x^2 + 7*x + 12); x^2 + 7*x + 12: % = factor( %); |
| > | FactorTable( 12*x^2 + 7*x + 1); 12*x^2 + 7*x + 1: % = factor( %); |
| > | FactorTable( 9*x^2 + 7*x + 11); 9*x^2 + 7*x + 11: % = factor( %); |
| > | FactorTable( 12*x^2 + 7*x + 1); 12*x^2 + 7*x + 1: % = factor( %); |
| > | FactorTable( 32*x^2 - 162); 32*x^2 - 162: % = factor( %); |
| > | FactorTable(16*x^2+42*x+27); 16*x^2+42*x+27: % = factor( %); |
| > | FactorTable(36*x^2-105*x-50); 36*x^2-105*x-50: % = factor( %); |
| > | FactorTable(252*x^2+477*x+100); 252*x^2+477*x+100: % = factor( %); |
| > | FactorTable(252*x^2+477*x-100); 252*x^2+477*x-100: % = factor( %); |
3. Factor by Grouping
"Factoring by grouping" is another method of factoring. One place, this method is very useful is when there are four terms. The idea is to group the first two terms, the last two terms, and the factor out a COMMON factor.
| > | FactorGrouping(x^3 + 5*x^2 +7*x + 35); |
| > | FactorGrouping(x^3 - 5*x^2 -9*x + 45); |
Sometimes there is more to be done after the factoring by grouping. In this case, we can still factor one of the terms further.
| > | factor(x^3 - 5*x^2 -9*x + 45); |
| > | FactorGrouping( 8*x^3 - 12*x^2 - 10*x + 15); |
The method of factoring by grouping can also be used for factoring trinomials.
| > | x^2 + 12*x + 32, ` = `, (x^2 + 4*x),` + `,(8*x + 32); |
| > | 6*x^2 + 19*x + 15; `6*15` = 6*15; `9 + 10` = 19; `9*10` = 90; |
| > | 6*x^2 + 19*x + 15, ` = `, (6*x^2 + 9*x),` + `,(10*x + 15); 6*x^2 + 19*x + 15, ` = `, 3*x,`*(`, 2*x + 3, `) + 5*(`, 2*x + 3, `)`; 6*x^2 + 19*x + 15, ` = (`, 3*x+ 5, `(`, 2*x + 3, `)`; |
4. Solving Equations by Factoring
Factoring the polynomials in equations allows us to solve them.
| > | x^2 -x -12= 0; |
| > | factored := factor(lhs(%)) = 0; |
Now we use the property : if a*b = 0, then a = 0 or b = 0. In other words, we separate this single equation with two factors into two simpler equations with one factor each - which are easier to solve.
| > | op(1,op(1,factored)) = 0; solve(%); |
| > | op(2,op(1,factored)) = 0; solve(%); |
We can also solve at once using a single Maple command of course. But this doesn't show how we got the answer.
| > | `Solutions are `,{solve( factored )} ; |
xxxx.
| > | x^2 + 39*x + 170 = 0; factored := factor(lhs(%)) = 0; op(1,op(1,factored)) = 0; solve(%); op(2,op(1,factored)) = 0; solve(%); `Solutions are `,{solve( factored )} ; |
| > | 21*x^2 + x - 10 = 0; factored := factor(lhs(%)) = 0; op(1,op(1,factored)) = 0; solve(%); op(2,op(1,factored)) = 0; solve(%); `Solutions are `,{solve( factored )} ; |
Of course, this only works if the polynomial factors.
| > | x^2 + 3*x - 11 = 0; factored := factor(lhs(%)) = 0; `Solutions are `,{solve( factored )} ; |
| > |
We will use other methods to solve these kinds of equations.
© 2002 Waterloo Maple Inc