Let the number of years ago be denoted as \( x \).
At that time, the man's age would have been \( 37 - x \) and the child's age would have been \( 8 - x \).
The product of their ages at that time is given by the equation:
\[ (37 - x)(8 - x) = 96 \]
Expanding this equation, we have:
\[ 296 - 37x - 8x + x^2 = 96 \]
Combining the terms gives:
\[ x^2 - 45x + 296 - 96 = 0 \]
This simplifies to:
\[ x^2 - 45x + 200 = 0 \]
Now, we can solve this quadratic equation using the quadratic formula:
\[ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \]
Here, \( a = 1 \), \( b = -45 \), and \( c = 200 \).
Calculating the discriminant:
\[ b^2 - 4ac = (-45)^2 - 4 \cdot 1 \cdot 200 = 2025 - 800 = 1225 \]
Taking the square root of the discriminant:
\[ \sqrt{1225} = 35 \]
Now substituting back into the quadratic formula:
\[ x = \frac{45 \pm 35}{2} \]
Calculating the two possible values for \( x \):
- \( x = \frac{45 + 35}{2} = \frac{80}{2} = 40 \)
- \( x = \frac{45 - 35}{2} = \frac{10}{2} = 5 \)
Since \( x \) represents the number of years ago, we need to consider positive values that fit within the context of their ages.
Thus, the possible solutions are:
- 40 years ago (not applicable as both ages would not be positive)
- 5 years ago
Now we check if the product of their ages 5 years ago would indeed equal 96:
The man's age 5 years ago was:
\[ 37 - 5 = 32 \]
The child's age 5 years ago was:
\[ 8 - 5 = 3 \]
Calculating the product:
\[ 32 \times 3 = 96 \]
Indeed, the product equals 96.
Thus, the answer is:
\[ \boxed{5} \]