Oh c'mon! This is simple!
The triangle is a right triangle. It is given an angle of 40 degrees, and since it is a right triangle, another angle is 90 degrees. Thus, the missing angle is 180 deg - 90 deg - 40 deg, which is 50 degrees.
Now, we can see that the 50 degree angle and the x + 138 degrees angle are supplementary angles, they add up to 180 degrees. We can write an equation.



As you can see, the answer is -8. If you think a little bit more, you can solve it too!