#color(white)(ax^3+3"ddd")x^2-3x-2#
#ul(color(white)("ddddddddddddd")5x-2 larr" Multiply")#
#color(white)("d")5x^3 -15x^2-10x color(white)("dddd")larr5x(x^2-3x-2)#
#ul(color(white)("dddd.d")-2x^2+color(white)("d")6x+4 larr-2(x^2-3x-2))#
#color(white)("d")5x^3-17x^2-color(white)("d")4x+4 larr"Added together"#
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Another approach
Given: #color(blue)((5x-2))color( green)((x^2-3x-2))#
Multiply everything in the right brackets by everything in the left
#color(green)( color(blue)(5x)(x^2-3x-2) color(white)("ddd")color(blue)(-2)(x^2-3x-2)) " Notice the minus"#
#color(white)("dddddddddddddddddddddddddddddd")" follows the 2"#
#5x^3-15x^2-10x color(white)("ddd")-2x^2+6x+4#
Regrouping
#5x^3-15x^2-2x^2-10x+6x+4#
#5x^3-17x^2-4x+4#