The numbers are x & y:
so y = -30 - x, and substitute in to the first: x*(-30 - x) = 40.
Now you have the quadratic:
x² +30x + 40 = 0. Numerically solving using the quadratic formula give:
x = -1.3985 or x = -28.6015 ; using one of these x solutions gives the other number for y. A check will verify that this is the solution to the original problem.
The two numbers are -2 and -15
21
61
260
-23
42
-10 and -3
13
-17
-117
26
5300