upstream means going in opposite direction of river's current
downstream means going in same direction of river's current
Let the speed of river's current be x km/hour
so net speed of boat in upstream = (9-x) km/hour
net speed of boat in downstream = (9+x) km/hour
total time taken = 2 hours 40 minutes = 8/3 hours
total time taken = time in upstream + time in downstream
( time = distance / speed)
8/3 = 6/(9-x) + 6/(9+x)
solving for x
x = 6.36 km/hour
so speed of river's current = 6.36 km/hour