Solution (source code)

= Solution

Write $A=V/D_3$ and $B=L/D_1$. Then $\tau=A/\lambda+B\lambda$, so
$$
\tau'=-\frac A{\lambda^2}+B=0,\qquad \tau''=\frac{2A}{\lambda^3}>0.
$$
Therefore
$$
\boxed{\lambda_*=\sqrt{\frac{VD_1}{LD_3}},\qquad
\tau_{\min}=2\sqrt{\frac{VL}{D_1D_3}}.}
$$
At the optimum, the two contributions are equal. Expressing the optimal sliding length directly in terms of the minimum time gives
$$
\boxed{\lambda_*=\frac{D_1\tau_{\min}}{2L}=\frac{2V}{D_3\tau_{\min}}.}
$$
These relations concern the optimal point; a general nonminimal time can correspond to two different sliding lengths. A geometric or kinetic restriction on the allowed sliding length can instead place the optimum at a boundary.