here we are looking for time in weeks, so lets make the variable w = number of weeks
we are given the starting amounts, the money added per week, and are told that after w weeks the two amounts are the same. We can make an equation using the variable w, with this information.
20 + 4*w = 15 +5*w
-15 -15
____ _____
5 + 4w = 5w
-4w -4w
___ ___
5 = w
This tells us the time required is 5 weeks
To check the answer put 5 weeks into the original problem
$20 + $4/week *5 weeks = $40 = $15 + $5/week * 4 weeks