Can someone help me answer this question? It's combining like terms, my teacher said that the first term is right but the rest is wrong.

Question~~
2x^2y–5xy–7xy–8x^2y+9xy^2 –xy^2

My answer ~~
2x^2+-8x^2
(2-8)x^2
-6x^2
y+y+y+y
(1+1+1+1)y
4y
-5x+-7x+9x+-x
(-5-7+9-1)x
-4x
y^2+7^2
(1+1)y^2
2y^2
The answer that I got is~~ -6x^2+2y^2+4y-4x

To combine like terms, you need to group together terms that have the same variables and exponents. Let's go through each term in the expression one by one:

2x^2y - This term has the variables x, y, and an exponent of 2 for x. No other terms in the expression have the same combination, so this stays as it is.

Next, let's look at the terms involving just x and y:

-5xy - 7xy - 8x^2y + 9xy^2 -xy^2

To combine these terms, we need to add or subtract the coefficients (numbers) in front of them. Let's rearrange them to bring similar terms closer:

-5xy - 7xy - 8x^2y + 9xy^2 - xy^2

(-5xy - 7xy) - 8x^2y + (9xy^2 - xy^2)

-12xy - 8x^2y + 8xy^2

Next, let's look at the terms involving just x:

-5x - 8x^2 + 9x - x

-5x + 9x - 8x^2 - x

3x - 8x^2

At last, let's look at the terms involving just y:

2y^2

Now, let's put it all together:

-6x^2 + 8xy^2 + 3x - 12xy + 2y^2

So, the correct answer is:

-6x^2 + 8xy^2 + 3x - 12xy + 2y^2

Please note that there might be different possible ways to arrange and combine the terms, but this is one correct way.