Let the cubic power + 3x power - 2xy-kx-4y of X be decomposed into the product of the first and second factors, and the value of the constant k is obtained

Let the cubic power + 3x power - 2xy-kx-4y of X be decomposed into the product of the first and second factors, and the value of the constant k is obtained

x^3+3x^2-2xy-kx-4y
=x^3+2x^2+x^2-kx-2y(x+2)
=x^2(x+2)+x(x-k)-2y(x+2)
x-k=x+2
k=-2