P02-SyntheticDivision.mws

High School Modules > Precalculus by Gregory A. Moore

     Synthetic Division


Developing the method of synthetic division of polynomials.

[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;

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

>    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:

>    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:

>   

  1.  Long Division of Polynomials


We know how to divide polynomials by long division.

>    LongDiv( x^2 + 5*x + 2, -3 );

matrix([[` `, ` `, x, 2, ` `], [` `, ` `, __, __, __], [x+3, `|`, x^2, 5*x, 2], [(x+3)*x, ` = `, x^2, 3*x, ` `], [` `, ` `, __, __, ` `], [` `, ` `, 0, 2*x, 2], [2*x+6, ` = `, ` `, 2*x, 6], [` `, ` `, ...

` `

` `

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

` `

>    LongDiv( x^3 - 4*x^2 + 3*x + 7, + 2 );

matrix([[` `, ` `, x^2, -2*x, -1, ` `], [` `, ` `, __, __, __, __], [x-2, ` `, x^3, -4*x^2, 3*x, 7], [(x-2)*x^2, ` = `, x^3, -2*x^2, ` `, ` `], [` `, ` `, __, __, ` `, ` `], [` `, ` `, 0, -2*x^2, 3*x, ...

` `

` `

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

` `


Now Lets find a slicker way of doing this!

  2.  The Method of Synthetic Division


If we abstract the long division process as much as possible we end up with what is called synthetic division. Lets look at an example and then we'll see how it can be converted to synthetic division.
 

        Example  2.1:      (x^2+5*x+2)/(x+3)

 

>    LongDiv( x^2 + 5*x + 2, -3 );

matrix([[` `, ` `, x, 2, ` `], [` `, ` `, __, __, __], [x+3, `|`, x^2, 5*x, 2], [(x+3)*x, ` = `, x^2, 3*x, ` `], [` `, ` `, __, __, ` `], [` `, ` `, 0, 2*x, 2], [2*x+6, ` = `, ` `, 2*x, 6], [` `, ` `, ...

` `

` `

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

` `


To divide synthetically ....
        we set it up in this way....create a table with the coefficients of the numerator along the top (right) and
        the root of the binomial divisor in the upper left corner.

        then we follow these steps :

                 
BRING DOWN  : bring down the leading coefficient ... all the way to the bottom

                 
MULTIPLY UP  : multiply the root (-3) by this number, and bring it up to 2nd row in the next column

       we repeat these steps until we have finished the table and there is nothing left to bring down

>    SynDiv( x^2 + 5*x + 2, -3 );

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


There are many things to notice about the bottom row of this table. If you compare it with the quotient and remainder we computed just above this, you'll see that the last entry in the bottom row is the remainder, and the other members of that row are the coefficients of the quotient. Of course the quotient has degree one less than the numerator since we are dividing by a binomial of degree one.

The advantages of this system are that its fast, easy, and less prone to errors. We merely need to read the answer off of the resulting last row to perform divisions.

Lets look at more examples.
 

        Example  2.2:      (x^3+11*x^2-13*x+8)/(x+5)

    

>    N := x^3 + 11*x^2 - 13*x + 8;
LongDiv( N, -5 );
SynDiv( N, -5 );

N := x^3+11*x^2-13*x+8

matrix([[` `, ` `, x^2, 6*x, -43, ` `], [` `, ` `, __, __, __, __], [x+5, ` `, x^3, 11*x^2, -13*x, 8], [(x+5)*x^2, ` = `, x^3, 5*x^2, ` `, ` `], [` `, ` `, __, __, ` `, ` `], [` `, ` `, 0, 6*x^2, -13*x...

` `

` `

(x^3+11*x^2-13*x+8)/(x-5) = x^2+6*x-43+223/(x-5)

` `

matrix([[-5, ` `, 1, 11, -13, 8], [` `, ` `, 0, -5, -30, 215], [` `, ` `, __, __, __, __], [` `, ` `, 1, 6, -43, 223]])


   

  


      Example  2.3:   
  (4*x^3+x^2-20*x+3)/(x-4)

 
 
When we divide by a binomial like (x - 4), the root is +4.

>    N := 4*x^3 + x^2 - 20*x + 3;
LongDiv( N , +4 );
SynDiv( N, +4 );

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

matrix([[` `, ` `, 4*x^2, 17*x, 48, ` `], [` `, ` `, __, __, __, __], [x-4, ` `, 4*x^3, x^2, -20*x, 3], [4*(x-4)*x^2, ` = `, 4*x^3, -16*x^2, ` `, ` `], [` `, ` `, __, __, ` `, ` `], [` `, ` `, 0, 17*x^...

` `

` `

(4*x^3+x^2-20*x+3)/(x+4) = 4*x^2+17*x+48+195/(x+4)

` `

matrix([[4, ` `, 4, 1, -20, 3], [` `, ` `, 0, 16, 68, 192], [` `, ` `, __, __, __, __], [` `, ` `, 4, 17, 48, 195]])




      Example  2.4 :   
  (7*x^3-9*x+11)/(x+2)

 
 

Just as with long division, we need to remember to place zero terms as placeholders for any missing terms. That much is the same.

>    N := 7*x^3 - 9*x + 11;
LongDiv( N , -2 );
SynDiv(  N,  -2 );

N := 7*x^3-9*x+11

matrix([[` `, ` `, 7*x^2, -14*x, 19, ` `], [` `, ` `, __, __, __, __], [x+2, ` `, 7*x^3, 0, -9*x, 11], [7*(x+2)*x^2, ` = `, 7*x^3, 14*x^2, ` `, ` `], [` `, ` `, __, __, ` `, ` `], [` `, ` `, 0, -14*x^2...

` `

` `

(7*x^3-9*x+11)/(x-2) = 7*x^2-14*x+19-27/(x-2)

` `

matrix([[-2, ` `, 7, 0, -9, 11], [` `, ` `, 0, -14, 28, -38], [` `, ` `, __, __, __, __], [` `, ` `, 7, -14, 19, -27]])

 3.  Synthetic Division In More Complicated Cases


This one is a little trickier ....
  

      Example  3.1 :   
  (x^3+6*x^2+5*x+13)/(4*x-3)

 
 

When dividing by a binomial with a coefficient in front of the x, we can use this trick ... factor that coefficient out. The quotient will be divided by that additional factor :
                                     
(x^3+6*x^2+5*x+13)/(4*x-3) = (x^3+6*x^2+5*x+13)/(4*(x-3/4))
 

>    print(4*x - 3 = 4,` * (`,x - 3/4,`)`);

4*x-3 = 4, ` * (`, x-3/4, `)`

>    N := 4*x^3 - 9*x + 11;
SynDiv( N, +3/4 );

N := 4*x^3-9*x+11

matrix([[3/4, ` `, 4, 0, -9, 11], [` `, ` `, 0, 3, 9/4, -81/16], [` `, ` `, __, __, __, __], [` `, ` `, 4, 3, -27/4, 95/16]])


This is not the answer. We need to divide by 4.

>    QQ := 4*x^2 + 3*x - 27/4; RR:= 95/16;

QQ := 4*x^2+3*x-27/4

RR := 95/16

>    QQ/4 + (RR)/(4*x -3);

x^2+3/4*x-27/16+95/16/(4*x-3)

>    PolyDivide( N, 4*x - 3);

(4*x^3-9*x+11)/(4*x-3) = x^2+3/4*x-27/16+95/16/(4*x-3)

Notice that we only divide the quotient by 4. The remainder is undivided, so it stays as is.




      Example  3.2 :   
  (x^3-4*x^2-122)/(7-x)

 
 

We use a similar trick on this problem - factor -1 out of the divisor to use synthetic division, then divide the quotient we get from synthetic division by -1.

>    print(7 - x = -1,` * (`,x - 7,`)`);

7-x = -1, ` * (`, x-7, `)`

>    N := x^3 -4*x^2 -122;
SynDiv( N, +7 );

N := x^3-4*x^2-122

matrix([[7, ` `, 1, -4, 0, -122], [` `, ` `, 0, 7, 21, 147], [` `, ` `, __, __, __, __], [` `, ` `, 1, 3, 21, 25]])

>    QQ := x^2 + 3*x - 21; RR:= 25;

QQ := x^2+3*x-21

RR := 25

>    QQ/(-1) + (RR)/(7-x);

-x^2-3*x+21+25/(7-x)

>    PolyDivide( N, 7 - x);

(x^3-4*x^2-122)/(7-x) = -x^2-3*x-21+25/(7-x)



 4.  Finding Roots


Whenever we divide a polynomial by a binomial and the remainder is zero, that means the binomial divides into the polynomial. And thus the root of the binomial is a root of the polynomial.

>    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]])

>    SynDiv(  168*x^3+731*x^2-862*x+96,  6/7);

matrix([[6/7, ` `, 168, 731, -862, 96], [` `, ` `, 0, 144, 750, -96], [` `, ` `, __, __, __, __], [` `, ` `, 168, 875, -112, 0]])

>    SynDiv(  6*x^4-19*x^3-106*x^2+21*x+18, -3 );

matrix([[-3, ` `, 6, -19, -106, 21, 18], [` `, ` `, 0, -18, 111, -15, -18], [` `, ` `, __, __, __, __, __], [` `, ` `, 6, -37, 5, 6, 0]])

>    SynDiv(  6*x^4-19*x^3-106*x^2+21*x+18,  -1/3 );

matrix([[-1/3, ` `, 6, -19, -106, 21, 18], [` `, ` `, 0, -2, 7, 33, -18], [` `, ` `, __, __, __, __, __], [` `, ` `, 6, -21, -99, 54, 0]])


         © 2002 Waterloo Maple Inc