Let <em>a</em> and <em>b</em> be the two numbers. Then
<em>a</em> + <em>b</em> = -4
<em>a b</em> = -2
Solve the second equation for <em>b</em> :
<em>b</em> = -2/<em>a</em>
Substitute this into the first equation:
<em>a</em> - 2/<em>a</em> = -4
Multiply both sides by <em>a</em> :
<em>a</em>² - 2 = -4<em>a</em>
Move 4<em>a</em> to the left side:
<em>a</em>² + 4<em>a</em> - 2 = 0
Use the quadratic formula to solve for <em>a</em> :
<em>a</em> = (-4 ± √(4² - 4(-2))) / 2
<em>a</em> = -2 ± √6
If <em>a</em> = -2 + √6, then
-2 + √6 + <em>b</em> = -4
<em>b</em> = -2 - √6
In the other case, we end up with the same numbers, but <em>a</em> and <em>b</em> are swapped.