Start with,

Look at first terms,
and
in divisor, with what do you have to multiply
so that you end up with
? The answer is
.
So you write,

(because you are subtracting
.
Which becomes when u subtract columns,

Now repeat the procedure,


which becomes

And again,


becomes,

Since the RHS is 0 that means
is a factor.
Now you can factor
because
and
.
Combine the factors and get
.
Hope this helps :)