In order to determine how the required distance, you take into account first the time the swimmwer would take to cross the river, without considering the current. To do that you use the formula for the distance traveled s, in a time t:
t = s/v
where v is the speed of the swimmer (5mph), s is the width of the river (1 mi). By replacing you obtain for t:
t = 1 mi/5mph = 0.2 h 0.2 hours
this is the time the swimmer takes to cross the river. Now, in the same time t, the current of the river will move the swimmer in the direction of the current. You calculate the distance the river moves the swimmer, by using the formula for distance:
s' = v't
where s' is the distance the river moves the swimmer downward, v' is the speed of the current (2 mph) and t is 0.2h. Then, by replacing you obtain:
s' = (2 mph)(0.2h) = 0.4 mi
Finally, you can consider ths distances s and s' as sides of a rectangle triangle. The distance betwen the starting point of the swimmer and his final point (the other edge of the river) is the hypotenuse of such a triangle. Then, by using the Pythagoras theorem you have:
r = √(s² + s'²)
by replacing the obtained values of s and s' into the formula for r you have:
r = √((0.4mi)² + (1 mi)²)
r = √(0.16mi² + 1mi²)
r = √(1.16mi²) = 1.07mi
Hence, the distance in between the starting point and final point of the trajectory of the swimmer is 1.07mile