You have the following expression:
(5x + 7) - (x + 2)
in order to simplify the previous expression, eliminate parenthesis and take into account that if a parenthesis is preceeded by a minus sign, when you elminate th eparenthesis the sign inside change to the opposite, just as follow:
(5x + 7) - (x + 2) =
5x + 7 - x - 2 =
5x - x + 7 - 2 =
4x + 5
Hence, the simplified expression is 4x + 5