Let the present age of the man be x years and that of his son be y years.
After 5 years man’s age = x + 5
After 5 years ago son’s age = y + 5
As per the question
x + 5 = 3(y + 5)
⇒ x – 3y = 10 ……………(i)
5 years ago man’s age = x – 5
5 years ago son’s age = y – 5
As per the question
x – 5 = 7(y – 5)
⇒ x – 7y = -30 …….(ii)
Subtracting (ii) from (i), we have
4y = 40 ⇒ y = 10
Putting y = 10 in (i), we get
x – 3 × 10 = 10
⇒ x = 10 + 30 = 40
Hence, man’s present age = 40 years and son’s present age = 10 years