P04-Factor Remainder Theorems.mws

High School Modules > Precalculus by Gregory A. Moore

     The Remainder Theorem & Factor Theorem


Exposition and application of the factor and remainder theorems.

[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

>    ccc := 'color = COLOUR(RGB, .6, .5, .5), thickness = 2':

>    LongDiv  :=  proc( P, r)
     local A, C, d, i,j,k,cols,rows,q,L2,dg, Q,R;
    d := degree( P);    cols :=  d + 3; rows := 3*d + 3;  
    for k from 0 to d do     C||k := coeff(P, x, k) ;  od;
    A := array( [seq( [  seq(` `, j = 1..cols ) ],   i = 1..rows) ]);

    A[3,1] := x-r;
    for k from 0 to d do  A[3,d - k + 3] :=  C||k*x^k ; od;
    for k from 0 to d do  A[2,d - k + 3] :=  `__`; od;
    A[k,2] :=  `|`;

    for k from 1 to d do
      q := simplify(A[3*k,2+k]/x);  A[1,2+k] := q;
      A[1+3*k,1] := A[3,1]* q;   A[1+3*k,2] := ` = `;
      L2 := expand(A[3,1]*q);   dg := degree(L2);
      A[1+3*k,2+k] := coeff(L2, x, dg)   *x^dg;   
      A[1+3*k,3+k] := coeff(L2, x, dg-1) *x^(dg-1);
      if (k > 1) then A[3*k,3+k] := A[3,3+k];  fi;
      for j from k+2 to k+3 do  A[2+3*k,j] :=  `__`; od;
      A[3 + 3*k,2+k] := A[3*k,2+k] - A[1+3*k,2+k];   
      A[3 + 3*k,3+k] := A[3*k,3+k] - A[1+3*k,3+k];
    od;
    print(A);
    Q := quo(  P , (x-r), x, 'R'):
    print(` `);print(` `);
    print(P/(x+r) = Q + R/(x+r));print(` `);
    end proc:

>    PolyLinFact  :=  proc(S,T)
    local Q,R;
    Q := quo( S, T, x, 'R'):
    print( expand('S'/T) = T*(sort(Q,x) + R/T));
    end proc:

>    SynDiv  :=  proc( P, r)
    local A, C, d, i,j,k;
    d := degree( P);
    for k from 0 to d do   C||k := coeff(P, x, k) ;  od;
    A := array( [seq( [  seq(` `, j = 0..(d+2) ) ],   i = 1..4) ]);
    A[1,1] := r;
    for k from 0 to d do  A[1,d - k + 3] :=  C||k ; od;
    for k from 0 to d do  A[2,d - k + 3] :=  0; od;
    for k from 0 to d do  A[3,d - k + 3] :=  `__`; od;
    for k from 0 to d do  
       A[4,k + 3] := A[1,k + 3] + A[2,k + 3];
       if(k<d) then A[2,k + 4] := r * A[4,k + 3]; fi
        od;
    print(A);
    end proc:

>   

>    N := 4*x^3 + x^2 - 20*x + 3;

N := 4*x^3+x^2-20*x+3

>    N := (x-3)*(x+5)*(x-4);

N := (x-3)*(x+5)*(x-4)

>    PolyLinFact( (x-3)*(x+5)*(x-4), x - 3);
PolyLinFact( (x-3)*(x+5)*(x-4), (x - 3)*(x-4));

x^2+x-20 = (x-3)*(x^2+x-20)

x+5 = (x-3)*(x+5)*(x-4)

>    SynDiv( N, +4 );

matrix([[4, ` `, 1, -2, -23, 60], [` `, ` `, 0, 4, 8, -60], [` `, ` `, __, __, __, __], [` `, ` `, 1, 2, -15, 0]])

>    SynDiv( x^4 + x^3 + x^2 + x + 1, -1);

matrix([[-1, ` `, 1, 1, 1, 1, 1], [` `, ` `, 0, -1, 0, -1, 0], [` `, ` `, __, __, __, __, __], [` `, ` `, 1, 0, 1, 0, 1]])

  1. The Remainder Theorem


One version of the
Remainder Theorem  is this :

 
    For a polynomial f(x), the following are equivalent :
        - f(r) = R
        - the remainder when (x-r) is divided into f(x) is R


It makes a connection between the remainder of a polynomial division and evaluating a polynomial. Let's look at some examples.

Example 1.1 :  Let's create a polynomial and pick a number r. Then we will evaluate both of the expressions above and note that the two are the same.

>    f := x -> 3*x^2 - 7*x + 11;
r := 4;

f := proc (x) options operator, arrow; 3*x^2-7*x+11 end proc

r := 4

>    f(r);

31

>    LongDiv( f(x), r);

matrix([[` `, ` `, 3*x, 5, ` `], [` `, ` `, __, __, __], [x-4, `|`, 3*x^2, -7*x, 11], [3*(x-4)*x, ` = `, 3*x^2, -12*x, ` `], [` `, ` `, __, __, ` `], [` `, ` `, 0, 5*x, 11], [5*x-20, ` = `, ` `, 5*x, -...

` `

` `

(3*x^2-7*x+11)/(x+4) = 3*x+5+31/(x+4)

` `



Example 1.2 :   Here is another example.

>    f := x -> x^3 + 10*x^2 - 100*x + 300;
r := -1;

f := proc (x) options operator, arrow; x^3+10*x^2-100*x+300 end proc

r := -1

>    f(r);

409

>    LongDiv( f(x), r);

matrix([[` `, ` `, x^2, 9*x, -109, ` `], [` `, ` `, __, __, __, __], [x+1, ` `, x^3, 10*x^2, -100*x, 300], [(x+1)*x^2, ` = `, x^3, x^2, ` `, ` `], [` `, ` `, __, __, ` `, ` `], [` `, ` `, 0, 9*x^2, -10...

` `

` `

(x^3+10*x^2-100*x+300)/(x-1) = x^2+9*x-109+409/(x-1)

` `


Example 1.3 :  Here is a harder example.

>    f := x -> x^7 - x^6 + 4*x^5 - 9*x^4 + 11*x^3 -2*x^2 + 8*x^2 - 12*x + 144;
r := -7/2;

f := proc (x) options operator, arrow; x^7-x^6+4*x^5-9*x^4+11*x^3+6*x^2-12*x+144 end proc

r := -7/2

>    f(r);

-1527777/128

>    LongDiv( f(x), r);

matrix([[` `, ` `, x^6, -9/2*x^5, 79/4*x^4, -625/8*x^3, 4551/16*x^2, -31665/32*x, 220887/64, ` `], [` `, ` `, __, __, __, __, __, __, __, __], [x+7/2, ` `, x^7, -x^6, 4*x^5, -9*x^4, 11*x^3, 6*x^2, -12*...

` `

` `

(x^7-x^6+4*x^5-9*x^4+11*x^3+6*x^2-12*x+144)/(x-7/2) = x^6-9/2*x^5+79/4*x^4-625/8*x^3+4551/16*x^2-31665/32*x+220887/64-1527777/128/(x-7/2)

` `


In all these cases, you can see that the number gotten from evaluating the polynomial is the same as the remainder.
 

  2. Evaluating a Polynomial using Synthetic Division


One application is to evaluate a polynomial by finding the remainder. In some cases, synthetic division is
faster than the actual evaluation.

Example 2.1 :   It might be debatable as to which is easier.

>    f := x -> x^4 + x^3 + x^2 + x + 1;

f := proc (x) options operator, arrow; x^4+x^3+x^2+x+1 end proc

>    f(-5);

521

>    SynDiv( f(x), -5 );

matrix([[-5, ` `, 1, 1, 1, 1, 1], [` `, ` `, 0, -5, 20, -105, 520], [` `, ` `, __, __, __, __, __], [` `, ` `, 1, -4, 21, -104, 521]])



Example 2.2 :   Here is another example. Which method is easier and faster?

>    f := x -> x^6 - 170*x^4 + 200*x^2 - 400*x  + 11;

f := proc (x) options operator, arrow; x^6-170*x^4+200*x^2-400*x+11 end proc

>    f(13);

50

>    SynDiv( f(x), 13 );

matrix([[13, ` `, 1, 0, -170, 0, 200, -400, 11], [` `, ` `, 0, 13, 169, -13, -169, 403, 39], [` `, ` `, __, __, __, __, __, __, __], [` `, ` `, 1, 13, -1, -13, 31, 3, 50]])


Example 2.3 :   Here is another example.

>    f := x -> x^11 + 3*x^10   - 7* x^9 +  20*x^8 + 30*x^7 + 31*x^6
          + 34*x^5  - 110*x^3  - 61*x^2 - 58*x  - 11;

f := proc (x) options operator, arrow; x^11+3*x^10-7*x^9+20*x^8+30*x^7+31*x^6+34*x^5-110*x^3-61*x^2-58*x-11 end proc

>    f(-5);

4

>    SynDiv( f(x), -5 );

matrix([[-5, ` `, 1, 3, -7, 20, 30, 31, 34, 0, -110, -61, -58, -11], [` `, ` `, 0, -5, 10, -15, -25, -25, -30, -20, 100, 50, 55, 15], [` `, ` `, __, __, __, __, __, __, __, __, __, __, __, __], [` `, `...


 

  3. Finding A Remainder by Evaluating a Polynomial


We can use the theorem in the other direction too. In some cases, its easier to evaluate a polynomials than it is to do a synthetic division.
Example 3.1 :   Find the remainder when x^4+x^3+x^2+x+1  is divided by (x+2).

>    f := x -> x^4 + x^3 + x^2 + x  + 1;

f := proc (x) options operator, arrow; x^4+x^3+x^2+x+1 end proc

>    f(-2);

11

>    SynDiv( f(x), -2 );

matrix([[-2, ` `, 1, 1, 1, 1, 1], [` `, ` `, 0, -2, 2, -6, 10], [` `, ` `, __, __, __, __, __], [` `, ` `, 1, -1, 3, -5, 11]])



Example 3.2 :   Find the remainder when x^20+x^10+1  is divided by (x -1).

This synthetic division is a bit large, but its quite easy to simply evaluate the polynomial.

>    f := x -> x^20  +  x^10  + 1;

f := proc (x) options operator, arrow; x^20+x^10+1 end proc

>    f( 1);

3

>    SynDiv( f(x),  1 );

matrix([[1, ` `, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [` `, ` `, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], [` `, ` `, __, __, __, __, __, __, __, __, __...


Example 3.2 :   Find the remainder when x^100+x^75+x^50+x^25+1  is divided by (x+1).

Warning: don't try doing the synthetic division unless you have a very large piece of paper!

>    f := x -> x^100 + x^75 + x^50 + x^25  + 1;

f := proc (x) options operator, arrow; x^100+x^75+x^50+x^25+1 end proc

>    f(-1);

1


 

  4. The Factor Theorem


The
Factor Theorem  is a corollary of the Remainder theorem :

 
    For a polynomial f(x), the following are equivalent :
        - f(r) = 0
        - (x-r) divides f(x)
        - r is a root of f(x)

        - the graph of f(x) has an x-intercept at x = r
     


This theorem makes a connection between the roots of a polynomial, and linear factors. Let's see it in action.

Example 4.1 :  

>    f := x -> 6*x^3+13*x^2-4;

f := proc (x) options operator, arrow; 6*x^3+13*x^2-4 end proc

>    r := -2;  f(r);
r := 1/2;  f(r);
r := -2/3;  f(r);

r := -2

0

r := 1/2

0

r := -2/3

0

This polynomial has three roots. We would expect three linear factors .....

>    factor(f(x));

(3*x+2)*(2*x-1)*(x+2)

>    plot( f(x), x = -3..2, y = -20..50, ccc );

[Maple Plot]

>    rt := solve( f(x) = 0, x);
display( pointplot( {[rt[1],0],[rt[2],0],[rt[3],0]}, symbolsize = 30, color = red),
         plot( f(x), x = -3..2, y = -20..50, ccc ));

rt := -2, 1/2, -2/3

[Maple Plot]





Example 4.2 :   Here is another example.

>    f := x -> 5*x^3+7*x^2+7*x+2;
r := -2/5;

f := proc (x) options operator, arrow; 5*x^3+7*x^2+7*x+2 end proc

r := -2/5

>    f(r);

0

>    factor(f(x));

(5*x+2)*(x^2+x+1)

>    display( pointplot( [r,0],  symbolsize = 30, color = red),         
         plot( f(x), x = -2..1, y = -15..20, ccc ));

[Maple Plot]


Whenever we have a root, we have a linear factor, and thus we have a way of decomposing the polynomial into a product of smaller degreed polynomials.

 


         © 2002 Waterloo Maple Inc