To get the initial term, namely x3, one needs to multiply the divisor, namely x−4 by x2. Doing this multiplication, of x−4 by x2, one gets x3−4x2. Subtracting this from x3−6x2+9x−4 yields the initial remainder −2x2+9x−4.
Once again one needs to divide this by x−4. To get the initial term −2x2 one needs to multiply x−4 by −2x. Doing this multiplication one gets −2x2+8x. Subtracting this from the initial remainder one gets x−4.
One needs to divide this second remainder by x−4. Clearly, x−4 times 1 is x−4 and there is no remainder. So, by adding up the multipliers, one gets x2−2x+1, which is equal to (x−1)2.