I know that there are different notations for the polynomial long division in different countries. I will use the one that I'm familiar with and hope that it will be easy for you to adapt it to your notation if needed. :-)
#color(white)(xii) (x^5 color(white)(xxxxx) - x^3 + x^2 - 2x - 5) -: (x-2) = x^4 + 2x^3 + 3 x^2 + 7x + 12#
#- (x^5 - 2x^4)#
#color(white)(xx) color(white)(xxxxxx)/color(white)(x)#
#color(white)(xxxxxx) 2x^4 - x^3#
#color(white)(xxx )- (2x^4 - 4x^3)#
#color(white)(xxxxx) color(white)(xxxxxxxx)/color(white)(x)#
#color(white)(xxxxxxxxxx) 3 x^3 + x^2#
#color(white)(xxxxxxx )- (3x^3 - 6x^2)#
#color(white)(xxxxxxxxx) color(white)(xxxxxxxx)/color(white)(x)#
#color(white)(xxxxxxxxxxxxxx) 7x^2 - 2x#
#color(white)(xxxxxxxxxxx )- (7x^2 - 14x )#
#color(white)(xxxxxxxxxxxxx) color(white)(xxxxxxxx)/color(white)(x)#
#color(white)(xxxxxxxxxxxxxxxxxx) 12x - 5#
#color(white)(xxxxxxxxxxxxxxxii )- (12x - 24)#
#color(white)(xxxxxxxxxxxxxxxxx) color(white)(xxxxxxxx)/color(white)(x)#
#color(white)(xxxxxxxxxxxxxxxxxxxxxxx) 19#
Thus,
#(x^5 - x^3 + x^2 - 2x - 5) / (x-2) = x^4 + 2x^3 + 3 x^2 + 7x + 12#
with the remainder #19#, or:
#(x^5 - x^3 + x^2 - 2x - 5) / (x-2) = x^4 + 2x^3 + 3 x^2 + 7x + 12 + 19/(x-2)#