Speed of the boat in still water = 5 km/h
Let the speed of stream = x km/h
∴ Speed of boat upstream = (5 − x) km/h
Speed of boat downstream = (5 + x) km/h
Time taken to row 40 km upstream =
Time taken to row 40 km downstream =
According to the given condition,
Therefore, the speed of the stream is 2.5 km/h.