To multiply these three terms, first, we need to multiply the two terms on the right by multiplying each individual term in the center parenthesis by each individual term in the right parenthesis.
#(x - 1)(color(red)(-2x) - color(red)(5))(color(blue)(x) - color(blue)(8))# becomes:
#(x - 1)((color(red)(-2x) xx color(blue)(x)) + (color(red)(2x) xx color(blue)(8)) - (color(red)(5) xx color(blue)(x)) + (color(red)(5) xx color(blue)(8)))#
#(x - 1)(-2x^2 + 16x - 5x + 40)#
We can now combine like terms:
#(x - 1)(-2x^2 + (16 - 5)x + 40)#
#(x - 1)(-2x^2 + 11x + 40)#
We can now multiply these two terms using the same method:
#(color(red)(x) - color(red)(1))(color(blue)(-2x^2) + color(blue)(11x) + color(blue)(40))# becomes:
#(color(red)(x) xx color(blue)(-2x^2)) + (color(red)(x) xx color(blue)(11x)) + (color(red)(x) xx color(blue)(40)) + (color(red)(1) xx color(blue)(2x^2)) - (color(red)(1) xx color(blue)(11x)) - (color(red)(1) xx color(blue)(40))#
#-2x^3 + 11x^2 + 40x + 2x^2 - 11x - 40#
We can now group and combine like terms:
#-2x^3 + 11x^2 + 2x^2 + 40x - 11x - 40#
#-2x^3 + (11 + 2)x^2 + (40 - 11)x - 40#
#-2x^3 + 13x^2 + 29x - 40#