Let's call v=15 km/h the speed of the boat in still water, and c the speed of the current.
When the boat travels with the current, its total speed is (v+c), and it travels for a distance of 35 km in a time t. When the boat travels against the current, its total speed is (v-c), and it travels for a distance of 25 km in the same time t. We can write the basic relationship of the uniform linear motion [tex]S=vt[/tex] for both situations:
[tex]35 km = (v+c)t[/tex]
[tex]25 km=(v-c)t[/tex]
If we divide the first equation by the second one, we find
[tex] \frac{35}{25}= \frac{v+c}{v-c} [/tex]
and by rearranging this, we can find the value of c, the speed of the current:
[tex]c= \frac{1}{6}v= \frac{1}{6}(15 km/h)=2.5 km/h [/tex]