Let x years be the present age of the father, then the present age of the son will be (45−x) years.
Five years ago, the age of father was (x−5) years and that of son was (45−x−5)=(40−x) years.
As, five years ago, the product of ages was 124.
(x−5)(40−x)=124
⇒x2−45x+324=0
⇒(x−9)(x−36)=0
⇒x=9,x=36
When x=36, the age of father is 36 and the age of son is 9 years.
When x=36, the age of the father is 9 years and the age of the son is 36 years, which cannot be possible, so the present age of father is 36 years and that of the son is 9 years.