Suppose you’re standing to the south of a lake, with the bank running straight east-west. You want to run to the water’s edge and swim to a boat anchored in the lake, some distance to the north-east. You can run faster than you can swim. Your running speed is $v_1$ and your swimming speed is $v_2$.

If you want to get to the boat as quickly as possible, what do you think your path should look like? Show answer

The shortest distance between two points is a straight line, so as long as your speed is constant you should be moving in a straight line, but at the water’s edge you can change direction. The only question is where to enter the water. Since you can’t move as fast in the water, you should enter the lake further to the east than if the speeds were equal, to reduce the distance you have to swim.

Show that \[\frac{\sin\theta_1}{v_1} = \frac{\sin\theta_2}{v_2}\] with $\theta_1$ and $\theta_2$ defined as in the previous answer. Some of you may recognise this as Snell’s law, which describes the path that light takes when travelling from air to glass or water, for example (refraction). This is because light travels more slowly in denser materials and likes to take the quickest path (Fermat’s principle). Show hint

We want to choose $x_1$ so that the time is minimised, so write an equation for the time, and differentiate it with respect to $x_1$, or $\theta_1$ if you prefer. Note that $y_1$, $y_2$, $v_1$, $v_2$, and $x_1 + x_2$ are constants.The time taken to reach the boat is $t = s_1/v_1 + s_2/v_2$. In order to minimise this, we must set its derivative to zero, so we need to know the derivatives of $s_1$ and $s_2$. \begin{align*} s_1^2 &= x_1^2 + y_1^2\\ 2s_1 \frac{\dif s_1}{\dif x_1} &= 2x_1 + 0\\ \frac{\dif s_1}{\dif x_1} &= \frac{x_1}{s_1}\\ &= \sin\theta_1 \end{align*} To find the derivative of $s_2$ we need to know $\frac{\dif x_2}{\dif x_1}$. Since $x_1 + x_2$ is the east-west distance between the start to the boat, it is constant, so: \begin{align*} \frac{\dif }{\dif x_1}(x_1 + x_2) &= 0\\ 1 + \frac{\dif x_2}{\dif x_1} &= 0\\ \frac{\dif x_2}{\dif x_1} &= -1. \end{align*} \begin{align*} s_2^2 &= x_2^2 + y_2^2\\ 2s_2 \frac{\dif s_2}{\dif x_1} &= 2x_2\frac{\dif x_2}{\dif x_1} + 0\\ &= -2x_2\\ \frac{\dif s_2}{\dif x_1} &= -\frac{x_2}{s_2}\\ &= -\sin\theta_2 \end{align*} \begin{align*} \frac{\dif t}{\dif x_1} &= \frac{1}{v_1} \frac{\dif s_1}{\dif x_1} + \frac{1}{v_2}\frac{\dif s_2}{\dif x_1}\\ 0 &= \frac{\sin\theta_1}{v_1} - \frac{\sin\theta_2}{v_2}\\ \frac{\sin\theta_1}{v_1} &= \frac{\sin\theta_2}{v_2} \end{align*}

You may have chosen to differentiate with respect to $\theta_1$ rather than $x_1$ (or $x_2$ or $\theta_2$ – all valid choices). In this case the constant east-west distance from start to boat is $y_1\tan\theta_1 + y_2\tan\theta_2$, giving: \begin{align*} \frac{\dif }{\dif \theta_1}(y_1\tan\theta_1 + y_2\tan\theta_2) &= 0\\ y_1\sec^2\theta_1 + y_2\sec^2\theta_2 \frac{\dif \theta_2}{\dif \theta_1} &= 0\\ \frac{\dif \theta_2}{\dif \theta_1} &= -\frac{y_1\sec^2\theta_1}{y_2\sec^2\theta_2}\\ &= -\frac{y_1\cos^2\theta_2}{y_2\cos^2\theta_1} \end{align*} The time taken to reach the boat is: \begin{align*} t &= \frac{y_1\sec\theta_1}{v_1} + \frac{y_2\sec\theta_2}{v_2}.\\ \frac{\dif t}{\dif \theta_1} &= \frac{y_1\sin\theta_1}{v_1\cos^2\theta_1} + \frac{y_2\sin\theta_2}{v_2\cos^2\theta_2} \frac{\dif \theta_2}{\dif \theta_1}\\ 0 &= \frac{y_1\sin\theta_1}{v_1\cos^2\theta_1} + \frac{y_2\sin\theta_2}{v_2\cos^2\theta_2} \left(-\frac{y_1\cos^2\theta_2}{y_2\cos^2\theta_1}\right)\\ &= \frac{y_1\sin\theta_1}{v_1\cos^2\theta_1} - \frac{y_1\sin\theta_2}{v_2\cos^2\theta_1}\\ &= \frac{y_1}{\cos^2\theta_1}\left(\frac{\sin\theta_1}{v_1} - \frac{\sin\theta_2}{v_2}\right)\\ \frac{\sin\theta_1}{v_1} &= \frac{\sin\theta_2}{v_2} \end{align*}