Let amount of years when product of their ages is 96, be Y
At that time(Y years from now), Peter will be 7 + Y, and Mary will be 3 + Y
Thus, we get:
(7 + Y)(3 + Y) = 96
----- FOILing left side of equation
, or
There's your quadratic equation
Solve for Y, the amount of years from now, when their ages will multiply to 96