<s>[INST] dividing polynomials using long division I'm not following logic of using long division on polynomials.
If you are using regular long division, we would do the following:
        +----------
      2 | 86

How many times does 2 go into 8? 4. Multiply 2 by 4 and drop down the next tenth power. So we end up with 6.
          4
        +----------
      2 | 86
          8
        -----------
           6

How many times does 2 go into 6. 3. So we add that to the next tenth place, and drop it down and continue doing this until we get 0 or a remainder.
          43
        +----------
      2 | 86
          8
        -----------
           6
           6
        -----------
           0

Now I am asked to do the same thing but with polynomials.
            +----------
      x + 3 | x^2 + 10x + 21

In order to solve this, we are told to determine how many times does x go into x^2. The answer is x because x*x=x^2. Then we are told to multiply that x by the whole divisor x + 3, so we get a result that looks like this:
              x
            +---------------
      x + 3 | x^2 + 10x + 21
              x^2 + 3x
            ----------------
                    7x + 21

And then again we ONLY check how many times x goes into 7x, which is 7 times, so our result looks like this:
                     x  + 7
            +---------------
      x + 3 | x^2 + 10x + 21
              x^2 + 3x
            ----------------
                    7x + 21
                    7x + 21
            ----------------
                          0

In the polynomial division, we are only checking to see how many times x goes into x^2. Shouldn't we be checking how many times x + 3 goes into x^2 + 10x? After all, if this was arithmetic, we don't break up the divisor into pieces, like how we are doing with the polynomials. If this was arithmetic, if we couldn't divide it, then we add a decimal point and a zero until we could. How come in polynomials, we are allowed to break up the divisor in pieces like this?
 [/INST] Let's take more easily comparable examples such as $\dfrac{156}{13}$ and $\dfrac{x^2+5x+6}{x+3}$
So for the numerical example, you first subtract $10\times 13$ and then $2 \times 13$ to get $156 = (10+2)\times 13$ so $\dfrac{156}{13}=12$, or laying it out
          10+2
        +----------
     13 | 156
          130
        -----------
           26
           26
        -----------
            0

while for the polynomial 
           x  +  2
        +-------------
    x+3 | x^2 + 5x + 6
          x^2 + 3x 
        --------------
                2x + 6
                2x + 6
        --------------
                     0

and the correspondence between $156 = (10+2)\times 13$  and $x^2+5x+6=(x+2)(x+3)$ is clear (though numerically the usual practice is write $12$ rather than $10+2$)
Now let's consider the slightly different $\dfrac{x^2+x-6}{x+3}$, to answer your question about why we only look at the leading terms: $x$ divides $x^2$ to give $x$, but $x+3$ would divide $x^2+x$ to give less, so when we do the subtraction $(x^2+x-6)-(x^2+3x)$ we get the apparently negative remainder $-2x-6$.  No matter: we can still match leading terms and $x$ divides $-2x$ to give $-2$.   This time you get 
           x  -  2
        +-------------
    x+3 | x^2 +  x - 6
          x^2 + 3x 
        --------------
               -2x - 6
                2x + 6
        --------------
                     0

and indeed $x^2 +  x - 6 = (x-2)(x+3)$. In polynomial long division, each step removes the leading term of the remainder from the previous step, and that only requires comparison of the leading terms of that remainder with the leading term of the divisor 
So long as there is a final remainder of $0$, this polynomial division approach will work, since you are subtracting and recording multiples of the divisor at each step (in these examples $x+3$).  If there is a final non-zero remainder, that can be part of the result too: compare $\frac{159}{13}=12 + \frac{3}{13}$ with $\frac{x^2+5x+9}{x+3}=x+2+\frac{3}{x+3}$ 
</s>