(p)*(x^2+x-3) = (px^2+px-3p)
Replacing (p) with (2x^2-5x-1)
(2x^2-5x-1)(x^2+x-3)
color(white)("XXXX")=(2x^2-5x-1)x^2 +(2x^2-5x-1)x - 3(2x^2-5x-1)
color(white)("XXXX")=(2x^4-10x^3-x^2)+(2x^3-5x^2-x)-(6x^2-15x-3)
color(white)("XXXX")=(2x^4) + (-10x^3+2x^3) + (-x^2-5x^2-6x^2) + (-x+15x) + (3)
color(white)("XXXX")=2x^4-8x^3-12x^2+14x+3