First you must distribute the 3 to the numbers inside the parentheses, which would be x and -1...
5 + (3*x) + (3 * (-1) )
5 + 3x + (-3)
5 + 3x - 3
Now you must combine like terms. Like terms are numbers that have matching variables OR are numbers with out variables. In this case the like terms are 5 and -3, since they both don't have any variables attached.
(5 + (-3) ) + 3x
2 + 3x
3x + 2 is 5 + 3(x - 1) simplified completely
Hope this helped!
~Just a girl in love with Shawn Mendes