Solution:Let the father age be 'x' years and son age be 'y' years
Given, The sum of the ages of father and his son is 45 years.
x + y = 45
⇒ y = 45 − x ...(i)
Given, 5 years ago, the product of their ages was 34
(x − 5) × (y − 5) = 34 ...(ii)
From (i) and (ii),
⇒ (x − 5)(45 − x − 5) = 34
⇒ (x − 5)(40 − x) = 34
⇒ 40x − x² − 200 + 5x = 34
⇒ −x² + 45x − 200 − 34 = 0
⇒ x² − 45x + 234 = 0
⇒ x² − 39x − 6x + 234 = 0
⇒ x(x − 39) − 6(x − 39) = 0
⇒ (x − 6)(x − 39) = 0
⇒ x = 6, 39
Therefore, father's age is 39 years and Son's age is 6 years.