One way is to keep trying pairs of consecutive positive even integers until you find a pair that satisfies the question.
Trying 2 and 4:
2^2 + 4*4 = 20
That was not 40. Trying the next pair:
Trying 4 and 6:
4^2 + 4*6 = 40
The answer is 4 and 6!
Sorry this is hard to read :-(
The labeled angle is what's called an inscribed angle. There's a theorem (fittingly called the inscribed angle theorem) that says the measure of this angle is half the measure of the circular arc that it subtends.
In this case, the angle is subtended by an arc measuring 180°. So
(4x + 6)° = 1/2 • 180°
4x + 6 = 90
4x = 84
x = 21