Let b be the speed of the boat ;
c be the speed river's flow (aka current)
Remember that distance = speed x time
When the boat travels downstream, it goes with the current. Thus, its speed is increased.
The downstream travel is represented by the equation
2 (b+c) = 64 (2 hours is the amount of time it traveled; 64 is the total distance traveled)
On the other hand, when it travels upstream, the boat goes against the current. Thus, its speed is decreased. This is shown by the equation
3 (b-c) = 54 (it took 3 hours to travel 54 km)
We now have a system of equation with two variables.
2b + 2c = 64 ––> b + c = 32
3b - 3c = 54 ––> b - c = 27
2b = 59
b = 59/2 = 29.5
c = 2.5
Therefore, the rate of the river's flow is 2.5 km/hour