Let x be the present age of the father and y be the present age of the son.
After five years, the father’s age will be (x+5) and the age of son will be (y+5), then,
x+5=3(y+5)
x−3y−10=0 .... (1)
Five years ago, the age of the father was (x−5) and son’s age was (y−5), so,
(x−5)=7(y−5)
x−7y+30=0 .... (2)
From subtracting equation (1) from (2),
−3y+7y−10−30=0⇒y=10
Putting y=10 in (1),
x−3(10)−10=0⇒x=40
Therefore, the present age of father is 40 years and that of son is 10 years.