Given, speed of the boat in still water = 5 km/hr
Let's assume the speed of the stream = k km/hr
Speed of the boat upstream = (5 – k) km/hr
Speed of the boat downstream = (5 + k) km/hr
Time to cover 40 km upstream = 3 × Time to cover 40 km downstream
40/(5-k) = 3x40/(5+k)
3x(5-k) = 5+k
4k = 10
Speed of the stream k = 2.5 km/hr.