Going downstream12 miles in 20 minutes is 36mph. 12m/(1/3hr)=36mph
Going Upstream 12 miles in 30 minutes is 24mph. 12m/(1/2hr)=24mph
The speed going downstream is the speed of the boat plus the speed of the river, while the speed going upstream is the speed of the boat minus the speed of the river.
The difference in the speed upstream versus downstream is twice the speed of the river.
The speed of the river is 6mph, or half the difference in speeds
Then just plug the speed (along with the U or D value calculated in the first step) into either the U or the D equation
The speed of the boat is 30mph