A person going at a rate of 5 km/hr in still water,takes thrice as much time in going 40km upstream as in going downstream. Find the speed of the stream.

let the speed of the current be x km/h

time against the current = 40/(5-x)
time with the current = 40/(5+x)

40/(5-x) = 3(40)/(5+x)
1/(5-x) = 3(5+x)
15-3x = 5+x
-4x=-10
x=2.5
the speed of the stream is 2.5 km/h

check:
time against the current = 40/2.5 = 16 hrs
time withe the current = 40/7.5 = 5 1/3 hrs
3 times 5 1/3 hrs = 16 hrs