Let the past age of father = 7x
Now
Present ages are x+5 (son) and 7x+5 (father)
5 years from now
Future age of son = x+10
Future age of father = 7x+10
Given,
after 5 years father's age = 3 times son's age then
7x+10 = 3*(x+10)
7x+10 = 3x+30
7x-3x = 30-10
4x = 20
x = 20/4
x = 5
Son's age = x+5 = 10
Father's age = 7x+5 = 40