Hello!

Recall that:
distance = speed × time
In this instance, the distance going downstream and upstream is equal. All we need to do is express speed to solve:
Find the speed going upstream and downstream:
20 / 40 = 1/2 mi / min * 60 min / 1 hour = 30 mph
20 / 60 = 1/3 mi / min * 60 min / 1 hour = 20 mph
Find the speed of the current by expressing a downstream current as + c and upstream current as -c. The speed of the boat (s), without current, would be the same.
s + c = 30
s - c = 20
We can isolate s to solve for c:
s = 30 - c
s = 20 + c
Set the two equations equal to each other:
30 - c = 20 + c
Add c to both sides:
30 = 20 + 2c
Subtract 20 from both sides:
10 = 2c
Divide both sides by 2:
c = 5 mph.