In Question 11.2.14 we considered the shortest path from a starting point, some distance north of a river running east-west, to a camp, stopping at the river on the way to get water.

We want to know the shortest total distance, $s = s_1 + s_2$, where \begin{align*} s_1^2 &= x_1^2 + Y_1^2 & s_2^2 &= x_2^2 + Y_2^2 \end{align*} by Pythagoras’ theorem (Section 11.2: Pythagoras' Theorem). I’m using the convention of capital letters for constants and lowercase letters for variables – $X$, $Y_1$, and $Y_2$ are given, whereas $x_1$, $x_2$, $s$, $s_1$, and $s_2$ depend on choices we make.

Show that $s$ is minimised when \[\frac{x_1}{s_1} = \frac{x_2}{s_2}\] that is, the two triangles must be similar. Show hint

We want $\frac{\dif s}{\dif x_1} = 0$. $X = x_1 + x_2$. Remember that any derivative of a constant is zero.

We want to choose $x_1$ so that $s$ is minimised, so what we need is $\frac{\dif s}{\dif x_1} = 0$. Let’s start by finding $\frac{\dif x_2}{\dif x_1}$ which we can do implicitly: \begin{align*} X &= x_1 + x_2\\ \frac{\dif X}{\dif x_1} &= \frac{\dif x_1}{\dif x_1} + \frac{\dif x_2}{\dif x_1}\\ 0 &= 1 + \frac{\dif x_2}{\dif x_1}\\ \frac{\dif x_2}{\dif x_1} &= -1 \end{align*} or by solving for $x_2$ first: \begin{align*} x_2 &= X - x_1\\ \frac{\dif x_2}{\dif x_1} &= -1 \end{align*}

Now to differentiate $s_1$ and $s_2$. This is made much easier by implicit differentiation: \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}\\\\ 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}\\\\ s &= s_1 + s_2\\ \frac{\dif s}{\dif x_1} &= \frac{\dif s_1}{\dif x_1} + \frac{\dif s_2}{\dif x_1}\\ 0 &= \frac{x_1}{s_1} - \frac{x_2}{s_2}\\ \frac{x_1}{s_1} &= \frac{x_2}{s_2} \end{align*}