M = x3 + x2y - 2x2 - xy - y2 + 3y + x + 2017
M = (x3 + x2y - 2x2) - (xy + y2 - 2y) + (x + y - 2) + 2019
M = x2. (x + y - 2) - y(x + y - 2) + (x + y - 2) + 2019 = 2019
\(M = x^3 + x^2y - 2x^2 - xy - y^2 + 3y + x + 2017.\)
\(M=(x^3+x^2y-2x^2)-(xy-y^2+2y)+(x+y-2)+2019\)
\(M=x^2.(x+y-2)-y.(x-y+2)+(x+y-2)+2019\)
\(M=x^2.0-y.0+0+2019\)
\(M=0-0+0+2019\)
\(M=2019\)