The two numbers I will call x and y.
x + y = 31
x * y = 150
You then solve for one variable in either equation and substitute it into the other equation.
x + y = 31
x = 31 - y
Then you plug it in:
x * y = 150
(31 - y) * y = 150
-y² + 31y = 150
y² - 31y + 150 = 0 Then factor:
(y - 6)(y - 25) = 0
y - 6 = 0 y - 25 = 0
y = 6 y = 25
When you plug y into the original equations, it comes out that the two numbers are 6 and 25. You can check your work because 6+25 = 31 and 6*25 = 150. Hope this helps! :)