One way to approach this problem is to use system of equations.
x-first number,
y-second number.
The system:
Sum = 2;
equation is x+y=2.
Product =126,
equation is xy=126.
We use substitution method.
x=2-y (Equation 1)
and substitute in Equation 2:
(2-y)y=126.
2y-y2=126.
y2 - 2y +126=0.
This quadratic equation does not have real roots. This means that the two numbers x and y are complex numbers.
Using quadratic formula and simplifying, we find that
(Try to to calculations yourself. If you have questions, please ask)
y=1-i5√5
x=1+i5√5
or vice-versa.