We know that whatever value we have for

, the best course to the shore is a straight line, with no curves. To find this distance, we simply use geometry.

We know that the shortest distance from ship to shore makes a right angle. The distance from the boat to shore such that

is an unknown variable, therefore, is the hypotenuse of a triangle made with the shortest route to shore and the shore itself. We know the former: it's

. We also know the latter, which is

. So, the hypotenuse, then, using the Pythagorean theorem, is

. That should be enough for you to make the function

.

Just in case it's not, though, here you go: Next we plug in time values.

is the time it takes to row to shore, and

is the time it takes to walk the remaining distance. Therefore: