Answer: (x - y)(x + 2)
Work Shown
Factor by grouping
x^2 + 2x - xy - 2y
(x^2 + 2x) + (-xy - 2y)
x(x + 2) -y(x + 2)
(x - y)(x + 2)
The FOIL rule can be used to verify the answer is correct.
The idea of factor by grouping is to pair up the terms and factor each sub-group. Then we factor out the overall GCF, which is (x+2) in this case.