As shown in the graph above, the point G is in the interior of the right angled triangle. Angle ABG measures (x^2 + 3x) while angle CBG measures 40x.
Angles ABG and CBG add up to 90 and that gives you;

Knowing that we are dealing with a positive angle measure, we shall take x = 2 (and not x = -45)
Therefore, x = 2, and angle ABG measures

Also angle CBG measures;
