TITLE: Optimal route consisting of rowing then walking
QUESTION [6 upvotes]: Problem
You're in a boat on point A in the water, and you need to get to point B on land. Your rowing speed is 3km/h, and your walking speed 5km/h.
See figure:

Find the route that takes the least amount of time.
My idea
I started by marking an arbitrary route:

From here, I figure the total time is going to be $$T = \frac{R}{3\mathrm{km/h}} + \frac{W}{5\mathrm{km/h}}$$
Since this is a function of two variables, I'm stuck.
A general idea is to express $W$ in terms of $R$ to make it single-variable, and then apply the usual optimization tactics (with derivatives), but I'm having a hard time finding such an expression.
Any help appreciated!
EDIT - Alternative solution?
Since the distance from A to the right angle (RA) is traveled 3/5 times as fast as the distance between RA and B, could I just scale the former up?
That way, I get A-RA being a distance of $6\cdot\frac53 = 10\mathrm{km}$, which makes the hypotenuse $\sqrt{181}$ the shortest distance between A and B. And since we scaled it up, we can consider it traversable with walking speed rather than rowing speed!
Thoughts?

REPLY [2 votes]: Snell's Law is usually applied to optics, but it is based on the quickest path through two media in which the speed of light differs. Snell's Law says that
$$
n_1\sin(i_1)=n_2\sin(i_2)\tag1
$$
where $i_k$ is the angle of incidence to the boundary of the path and $n_k$ is inversely proportional to the speed in the particular medium ($n_kv_k=c$).
We can adapt this to the current situation by noting that $(1)$ is equivalent to
$$
\frac{\sin(i_1)}{v_1}=\frac{\sin(i_2)}{v_2}\tag2
$$
If we travel at all along the shore, $\sin(i_2)=1$ (the angle of incidence is $90^\circ$). Since $v_1=3$ and $v_2=5$, we must have $\sin(i_1)=\frac35$, which implies that $\tan(i_1)=\frac34$.
If $\tan(i_1)=\frac34$, and the width of the river is $6$ km, then the downriver distance must be $\frac34\cdot6=4.5$ km.

This path takes $\frac{7.5}3+\frac{4.5}5=3.4$ hours.