Using one variable.

Let age of Son two years ago be = Son.

Then father's age two years ago was = 3 * Son

Son's age two years hence (after the present ) = Son + 4

Father's age after two years hence = 3 * Son + 4

hence, 2 * (3 * Son + 4) = 5 ( Son + 4)

Son = 12

Son was 12 years old , two years ago. Hence father was 36 yrs old.

They are now 14 years and 38 years old.

============================================

using two variables:

two years ago:

Father - 2 years = 3 * ( son - 2 years)

=> Father = 3 * son - 4 --- equation 1

after two years from now , in future

2 * (father + 2 years ) = 5 * (son + 2 years)

=> 2 * father = 5 * son + 6 --- equation 2

Multiply equation 1 by 2 and subtract equation 2 from it:

0 = son - 14 => son is 14 years old now

Father = 3 * 14 - 4 = 38 years now