P = x3 - y2 + x + x2y - 2x2 + 3y - xy + 2021
= x3 - y2 + x + x2y - (x + y)x2 + 3y - xy + 2021 (do x + y = 2)
= x3 - y2 + x + x2y - x3 - x2y + 3y - xy + 2021
= -y2 + x + 3y - xy + 2021
= -y2 + 2y - xy + (x + y) + 2021
= -y2 + (x + y).y - xy + 2 + 2021 (Do x + y = 2)
= -y2 + xy + y2 - xy + 2023
= 2023
Vậy P = 2023