Answer:
a = 5 and b = 3
Explanation:
2(x + a) + b(x + 7) can be simplified so that it is in the same configuration as the right side of the equation (an x term and then a constant).
2(x + a) + b(x + 7)
2x + 2a + bx + 7b
2x + bx + 2a + 7b
(2+b)x + 2a + 7b
At this point we can see that the x term on the left side of the equation is
(2+b)x and on the right side of the equation the x term is 5x. So b must be 3.
Here's an equation to show that logic.
(2+b)x = 5x
2x + bx = 5x
2x - 2x + bx = 5x -2x
bx = 3x
b = 3 if x isnot= 0
2a +7b was our constant. That was equal to 31, now we know b=3.
2a + 7b = 31
2a + 7(3) = 31
2a + 21 = 31
2a + 21 - 21 = 31 - 21
2a = 10
a = 5