5x-2x+6x+40-9+1-x+3x-8+15+7
First you would combine like terms:
5x - 2x + 6x - x + 3x = 11x and
40 - 9 + 1 - 8 + 15 + 7 = 46, so the simplified expression would be
11x + 46