[originally on newsgroup; here, with all corrections, plus $deconv$] let's look at an example computed by hand: 6 x^4 - 3 x^3 + 17 x^2 - 7x + 9 divided by 3 x^2 + 1 let's write 3 x^2 + 1 as 3 x^2 + 0 x + 1. 2 x^2 - 1 x + 5, with remainder -6 x + 4 +--------------------------------- 3 x^2 + 0 x + 1 | 6 x^4 - 3 x^3 + 17 x^2 - 7 x + 9 6 x^4 + 0 x^3 + 2 x^2 2 x^2 = 6 x^4 / 3 x^2 -------------------------------- - 3 x^3 + 15 x^2 - 7 x + 9 - 3 x^3 + 0 x^2 - 1 x -1 x = - 3 x^3 / 3 x^2 -------------------------- 15 x^2 - 6 x + 9 15 x^2 + 0 x + 5 5 = 15 x^2 / 3 x^2 ---------------- - 6 x + 4 conceptually, what is going on? 1. shift divisor 3 x^2 + 0 x + 1 until it's lead term 3 x^2 is lined up with the lead term 6 x^4 of dividend 6 x^4 - 3 x^3 + 17 x^2 - 7x + 9 2. divide dividend's remaining lead term (e.g. 6 x^4) by divisor's lead term (3 x^2) to get next term (e.g. 6 x^4 / 3 x^2 = 2 x^2) in quotient 3. subtract off corresponding multiple (e.g. 2 x^2 * (3 x^2 + 0 x + 1)) of divisor from dividend 4. repeat until left with remainder _______________________________________________________________________________ let's check our answer using $deconv$: p1 = [9 -7 17 -3 6]; % canonical rep. of 6 x^4 - 3 x^3 + 17 x^2 - 7x + 9 p2 = [1 0 3]; % canonical rep. of 3 x^2 + 1 [q,r] = deconv(fliplr(p1), fliplr(p2)); % compute quotient and remainder q = fliplr(q); r = fliplr(r); % fliplr here and above is because matlab's % poly rep is left-to-right instead of % left-to-right q % should be [5 -1 2], the canonical rep. of 2 x^2 - 1 x + 5 r % should be (something like) [4 -6], the canonical rep. of -6 x + 4