Let's define
r: speed of the river
By definition:
speed = distance/time
The speed of the boat depends on the boat's own speed and the speed of the river. Then upstream:
6 - r= 5/t
or
t = 5/(6 - r)
and downstream:
6 + r= 10/t
or
t = 10/(6 + r)
It takes them the same amount of time to go upstream as it does to go downstream, then:
The speed of the river is 2 kilometers per hour