Not sure if you are looking for such a reasoning:

1. The boat is going down the river at a speed of

and it is going up the river at a speed of

2. In the first case the speed of the flowing water is added to the speed of the boat through the water and in the second case the speed of the flowing water is subtracted from the speed of the boat through the water. Therefore the mean of both velocities must be the speed of the boat through the water:

then the speed of the flowing water must be