#color(white)("ddddddddddddddd")2x^3+x^2-3x-40#
#color(magenta)(2/3x^2)(3x+1)color(white)("d")->color(white)("d")ul(2x^3+2/3x^2larr" Subtract"#
#color(white)("ddddddddddddddddd")0+1/3x^2-3x-40#
#color(magenta)(1/9x)(3x+1)color(white)("dd")->color(white)("dddddd") ul(1/3x^2+1/9x larr" Subtract")#
#color(white)("dddddddddddddddddddddd")0-28/9x-40#
#color(magenta)(-28/27)(3x+1)color(white)("d")-> color(white)("ddddddddd")ul(-28/9x-28/27larr" Subtract")#
#color(white)("ddddddddddd")" Remainder "->color(white)("d")0color(white)("dd")+1052/27#
Converting the remainder into part of the division #1052/27-:(3x+1)#
#color(magenta)(2/3x^2+1/9x-28/27+1052/(26(3x+1)))#