, and

Subtract this from
to get a remainder of

, and

Subtract this from the previous remainder to get a new remainder of

does not divide
, so we stop here.
What we've done is to write

then

and we stop here because the remainder term
has a degree less than the degree of the denominator.
Alternatively, we can be a bit tricky and notice that

Now,

so that

We can divide the first term by
easily to get

Next,

so that



which is the same result as before.