Let the speed of Mary with no current be x km/h
speed of current= 3 km/h
Time=distance/speed
distance swum against current=2km
Time taken to swim against current=2/(x-3)
distance swum with current=8km
Time taken to swim with current=8/(x+3)
Given that the time taken in both instances are the same, then:
2/(x-3)=8/(x+3)
solving for x we get:
2(x+3)=8(x-3)
2x+6=8x-24
6+24=8x-2x
30=6x
x=30/6=5 km per hour
Therefore we conclude that:
Mary's speed with no current is 5 km/h