Optimal route consisting of rowing then walking 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?

*

*a) the solution
The formula has already been indicated by wgrenard and AdamBL
$$
T = {1 \over 3}\sqrt {36 + \left( {9 - W} \right)^{\,2} }  + {1 \over 5}W
$$
differentiating that
$$
{{dT} \over {dW}} = {{5W + 3\sqrt {36 + \left( {9 - W} \right)^{\,2} }  - 45} \over {15\,\sqrt {36 + \left( {9 - W} \right)^{\,2} } }}
$$
and equating to $0$ gives
$$
\eqalign{
  & {{dT} \over {dW}} = 0\quad  \Rightarrow \quad 3\sqrt {36 + \left( {9 - W} \right)^{\,2} }  = 45 - 5W\quad  \Rightarrow   \cr 
  &  \Rightarrow \quad 9\left( {36 + \left( {9 - W} \right)^{\,2} } \right) = 25\left( {9 - W} \right)^{\,2} \quad  \Rightarrow   \cr 
  &  \Rightarrow \quad 9 \cdot 36 = 16\left( {9 - W} \right)^{\,2} \quad  \Rightarrow \quad W = 9 - \sqrt {{{9 \cdot 36} \over {16}}}  = 9 - {9 \over 2} = {9 \over 2} \cr} 
$$
which is a minimum, because the function is convex as already indicated.
Thus
$$
\left\{ \matrix{
  W_m  = 9/2 \hfill \cr 
  T_m  = 17/5 \hfill \cr 
  R_m  = 15/2 \hfill \cr}  \right.
$$


*

*b) Scaling
Your idea of scaling according to speed is quite entangling.
That means (if I understood properly) that you are transforming the triangle from space to time units.
But, by introducing different scaling factors for the two coordinates, you undermine the Euclidean norm,
which does not " transfer" between the two systems (if assumed valid in one, shall be modified in the other).  
Consider for example the transformation sketched below.   

From the mathematical point of view it is a linear scale transformation
$$
\left( {\matrix{   {y_1 }  \cr    {y_2 }  \cr  } } \right) =
 \left( {\matrix{   {1/v_1 } & 0  \cr    0 & {1/v_2 }  \cr  } } \right)
\left( {\matrix{   {x_1 }  \cr    {x_2 }  \cr  } } \right)
$$
Now, with constant $v_1, \,v_2$, any path in $x$ will transform in the corresponding path in $y$
(going through corresponding points).
If the path is a curve parametrized through a common parameter $\lambda$, not influencing  the $v_k$'s,
then, at any given value of $\lambda$ the point on the $x$ plane will transform into the corresponding
point in $y$ plane
$$
\left( {\matrix{   {y_{1}(\lambda) }  \cr    {y_{2}(\lambda) }  \cr  } } \right) =
 \left( {\matrix{   {1/v_1 } & 0  \cr    0 & {1/v_2 }  \cr  } } \right)
\left( {\matrix{   {x{_1}(\lambda)  }  \cr    {x_{2}(\lambda)  }  \cr  } } \right)
$$
and the minimal path in one plane will be the corresponding minimal path in the other.
But we shall also have that
$$
\frac{d}{{d\lambda }}\left( {\matrix{   {y_{1}(\lambda) }  \cr    {y_{2}(\lambda) }  \cr  } } \right) =
 \left( {\matrix{   {1/v_1 } & 0  \cr    0 & {1/v_2 }  \cr  } } \right)
\frac{d}{{d\lambda }}\left( {\matrix{   {x{_1}(\lambda)  }  \cr    {x_{2}(\lambda)  }  \cr  } } \right)
$$
that is that the "velocities" compose vectorially.
Therefore if $\lambda$ is the time, you shall go from $A$ to $C$ with a composition of a vertical
rowing speed and a horizontal walking speed (a "$\infty$-thlon"), which takes the same time as rowing $AH$ and walking $HC$.   
When, instead, you just row on $AC$, then you shall change the above matrix - for that segment only - according to the $\angle AC$, 
and of course you loose the correspondence minimal to minimal as based on the Euclidean norm (straight line $A'B'$). 
