Vedic Sutra #4:     Transpose and Apply

We want to divide: anxn + an-1xn-1 + ... + a0   by   x - p     to find a Quotient and Remainder

Note:
      23 divided by 6 is 3 with a remainder of 5.
or, to put it differently:
      23 = (6)(3)+5
or, to put it differently:
      Divident = (Quotient)(Divisor) + Remainder
... which explains the terms we'll use

Example 1: (12x2 - 8x - 32) / (x - 2)

  1. Divide 12x2 by x to get 12x . (Note the coefficient is 12.)
    Then 12x is the first term in the quotient.
    (The quotient will then be: 12x + something ... plus some remainder R)
  2. Multiply the 12 by 2 (that's 24) and add the next coefficient - 8 to get 24 - 8 = 16.
    Then 16 is the next number in the quotient.
    The quotient is then 12x + 16.
  3. Multiply the 16 by 2 and add the next coefficient - 32 to get 32 - 32 = 0 which is the remainder R.
Conclusion?
      (12x2 - 8x - 32) / (x - 2) = 12x + 16 with a remainder of R = 0
or, to put it differently
      12x2 - 8x - 32 = (12x + 16)(x - 2) + 0
General Rule: to divide some Dividend by a Divisor: x - p
  1. Divide the highest order terms to get the first term in the quotient. Note its coefficient.
  2. Multiply this coefficient by p and add the next coefficient in the Dividend .
    This gives the next coefficient in the quotient.
  3. Multiply this next coefficient by p and add the next coefficient in the Dividend .
    This gives the next coefficient in the quotient.
  4. Repeat until all coefficients in the Dividend have been used. The last number generated is the remainder.

Example 2: (x3 - 3x2 + 10 x - 7) / (x - 5)

  1. Divide x3 by x to get x2 (or 1x2).
    That coefficient 1 will give the first term in the quotient.
    The quotient will be:
    1x2 + something ... plus some remainder R.
  2. Multiply that 1 by 5 (that's 5) and add the next coefficient in the Dividend, -3, to get 5 - 3 = 2.
    Then 2 is gives next term in the quotient which now looks like:
    1x2 + 2x + something ... plus some remainder R
  3. Multiply that 2 by 5 (that's 10) and add the next coefficient in the Dividend, 10, to get 10+10 = 20.
    Then 20 gives the next term in the quotient which now looks like:
    1x2 + 2x + 20 ... plus some remainder R
  4. Multiply the 20 by 5 (that's 100) and add the next coefficient in the Dividend, -7, to get 100-7 = 93.
    Then 93 is the remainder.
Conclusion?
      x3 - 3x2 + 10 x - 7 = (x 2+ 2x + 20)(x - 5) + 93
Why?
Remember: Dividend = (Quotient)(Divisor) +Remainder.
(Quotient)(Divisor) = (bn-1xn-1 + bn-2xn-2 + bn-3xn-3 + ... + b0) (x - p) +R     now multiply and collect like terms
Dividend = anxn + an-1xn-1+ an-2xn-2 +... =bn-1xn + (bn-2 - pbn-1)xn-1 + (bn-3 - pbn-2)xn-2 + ... - pb0 + R

Equating coefficients, we identify the quotient coefficients ... one-by-one:
    an = bn-1     "transpose" to get    bn-1 = an
    an-1 = bn-2 - pbn-1     transpose to get    bn-2 = pbn-1 + an-1
    an-2 = bn-3 - pbn-2     transpose to get    bn-3 = pbn-2 + an-2

etc. etc. and all the coefficients in the Quotient, namely bn-1, bn-2, bn-3 ... are determined in terms of the earlier coefficients
... ending with:

    R = pb0 + a0

Note:
This R-value is obtained from the earlier formulas ... except it'd be called
    b-1 = pb0 + a0

We want to divide: anxn + an-1xn-1 + ... + a0   by   x2 - px - q     to find a Quotient and Remainder

We write:
anxn + an-1xn-1 + an-2xn-2+... = (bn-2xn-2 + bn-3xn-3 + bn-4xn-4 + ... + b1x + b0) (x2 - px - q ) + R     now multiply and collect like terms

The right-side is then:

bn-2xn + (bn-3 - pbn-2)xn-1 + (bn-4 - pbn-3 - qbn-2)xn-2 + (bn-5 - pbn-4 - qbn-3)xn-3 + ... + (- pb0 - qb1)x - qb0 + R

Equate coefficients, "transpose" ... and get the relationship between the coefficients:
    bn-2 = an
    bn-3 = pbn-2 + an-1
    bn-4 = pbn-3 + qbn-2 + an-2
    bn-5 = pbn-4 + qbn-3 + an-3
and this scheme is repeated until the last Dividend coefficient, a0, is used.

Each coefficient is then given in terms of the earlier coefficients     and, of course, the coefficients in the Dividend

Note:
When a1 appears on the right-side of the above formulas, we'll have b-1 on the left-side !
    b-1 = pb0 + qb1 + a1
That actually gives the first term in the remainder R.

When a0 appears on the right-side of the above formulas we ignore the term in p and get the last term in R.
    b-2 = qb0 + a0
That gives the last term in the remainder R.
So
    R = b-1x + b-2

Note:
The coefficients with negative subscript give the Remainder ... so we colour them magenta

A graphical scheme (as a memory aid, perhaps) is this

Multiplications by q and p and addition of a Dividend coefficient are shown.
A few "0" coefficients are added to retain some symmetry

Each column is added to generate a b-coefficient (as shown in the Example)

Example 3: (x4 - 4x2 + 12 x - 9) / (x2 - 2x + 3)
Note: We expect     Quotient = b2x2 + b1x + b0
and some Remainder = b-1x + b-2

Note:     n = 4     and     a4 = 1     a3 = 0     a2 = -4     a1 = 12     a0 = -9     and p = 2 and q = -3.
  1. b2 = a4 = 1
  2. b1 = pb2 + a3 = (2)(1)+(0) = 2
  3. b0 = pb1 + qb2 + a2 = (2)(2)+(-3)(1)+(-4) = -3
  4. b-1 = pb0 + qb1 + a1 = (2)(-3)+(-3)(2)+(12) = 0
  5. b-2 = qb0 + a0 = (-3)(3)+(-9) = 0
Note:
A more convenient diagram is shown below, where the result of multiplying is shown below.
Neither p nor q is involved in step #1 above (so they are missing from the first column in the diagram).
q is not involved in step #2 (so it is missing from the second column in the diagram).
p is not involved in the last step above (so it is missing from the last column in the diagram).


The top row has the coefficients in the Dividend
The next row has the result of multiplications by q = -3
The next row has the result of multiplications by p = 2
The last row is the sum of the numbers above it
... and has the coefficients associated with the Quotient and Remainder

Conclusion?
      (x4 - 4x2 + 12 x - 9) / (x2 - 2x + 3) = b2x2 + b1x + b0 = x2 + 2x - 3   and Remainder = b-1x + b-2 = 0

Example 4: (x3 + 2x2 + 3 x + 5) / (x2 - x - 1)
Note:
p = 1   and   q = 1   and the Dividend coefficients are: 1   2   3   5
We expect   Quotient = b1x + b0 and Remainder = b-1x + b-2
  1. b1 = a3 = 1
  2. b0 = pb1 + a2 = (1)(1)+(2) = 3
  3. b-1 = pb0 + qb1 + a1 = (1)(3)+(1)(1)+(3) = 7
  4. b-2 = qb0 + a0 = (1)(3)+(5) = 8
We ignore the p term in step 4.
     

Conclusion?
      (x3 + 2x2 + 3 x + 5) / (x2 - x - 1) = 1x + 3   and Remainder = 7x + 8

That is:

      (x3 + 2x2 + 3 x + 5) / (x2 - x - 1) = x + 3   +   (7x + 8 ) / ( x3 + 2x2 + 3 x + 5 )

We want to divide numbers     to find a Quotient and Remainder

Consider dividing 1241 by 112. That is, find the Quotient and Remainder for 1241 / 112.

  1. Write 1241 as 1(103) + 2(102) + 4(10) + 1     that's 1(x3) + 2(x2) + 4(x) + 1   with x = 10
  2. Write 112 as (102) + 1(10) + 2     that's (x2) + 1(x) + 2   with x = 10
  3. The Dividend coefficients are:     1   2   4   1
  4. The Divisor coefficients have:     p = -1   and   q = -2
  5. We expect
        Quotient = b1(10) + b0
    and
        Remainder = b-1(10) + b-2
  6. Our diagram looks like: