Like terms are defined as terms with the same variables that are raised to the same power.
For example, the terms axax and bx^2bx2 are NOT like terms because the coefficients aa and bb have variables (xx and x^2x2, respectively) that are not raised to the same power.
In the expression (5x^2+4)-(3x+7)+(2x^2-1)(5x2+4)−(3x+7)+(2x2−1), the like terms are grouped as follows:
5x^25x2 and 2x^22x2
-3x−3x (this is negative because the subtraction sign is "distributed" to the terms inside of the parentheses)
44, -7−7, -1−1 (the reason for why it's -7−7 is the same reason for why -3x−3x is negative)
Add the terms in the groups up...
5x^2 + 2x^2 = 7x^25x2+2x2=7x2
-3x−3x
4 - 7 - 1 = -44−7−1=−4
Now you have the simplified expression: 7x^2 - 3x - 47x2−3x−4