You can
put this solution on YOUR website! .
It can be easy solved MENTALLY without using equations.
Take for a minute these 4 extra years aside.
Then Sam's "corrected" age will be twice the Dave's age, and the sum of ages will be 46 - 4 = 42.
Then it is clear that Dave's age is one third of 42, i.e. 14 years, while Sam's "corrected" age is 28 years.
Now the last step is to return to Sam his 4 years back to get the
Answer. Sam is 32 years old; Dave is 14 years old.
Completed.