We perform a synthetic division
#color(white)(aaaa)##8##color(white)(aaaa)##|##color(white)(aaaa)##1##color(white)(aaaa)##-2##color(white)(aaaaa)##-40##color(white)(aaaaaa)##-64#
#color(white)(aaaaaa)##color(white)(aaaa)##|##color(white)(aaa)##color(white)(aaaaaaa)##8##color(white)(aaaaaa)##48##color(white)(aaaaaaaa)##64#
#color(white)(aaaaaaaaaa)#------------------------------------------------------------
#color(white)(aaaa)##color(white)(aaaaaa)##color(white)(aaaaaa)##1##color(white)(aaaaa)##6##color(white)(aaaaaaa)##8##color(white)(aaaaaaaa)##color(red)(0)#
The remainder is #=0#
The quotient is #=x^2+6x+8#
This is factorised as
#x^2+6x+8=(x+2)(x+4)#