Example 18.1. Two trains.
At time 1 pm a red train is traveling east toward a station at a rate of 50 km/h, while a blue train is traveling north away from the station at 100 km/h. At this moment the red train is 1 km from the station and the blue train is 0.25 km from the station. At what rate is the distance between the two trains changing at this moment in time? Take care to interpret the sign (\(\pm\)) of your numeric answer.
Solution.
We define
\begin{align*}
r(t) \amp = \begin{array}{c}
\text{dist. btwn. red train and station}\\
t \text{ hours after noon}
\end{array}\\
b(t) \amp = \begin{array}{c}
\text{dist. btwn. blue train and station}\\
t \text{ hours after noon}
\end{array}\\
d(t) \amp = \begin{array}{c}
\text{dist. btwn. red and blue trains}\\
t \text{ hours after noon}
\end{array}\text{.}
\end{align*}

It follows easily from Figure 18.2 that
\begin{equation}
d(t)^2=r(t)^2+b(t)^2\text{.}\tag{18.1}
\end{equation}
In terms of our introduced function notation, the given information of the problem is expressed as follows:
\begin{align*}
r(1) \amp = 1 \amp r'(1)\amp =-50\\
b(1) \amp = \frac{1}{4} \amp b'(1)\amp =100 \text{.}
\end{align*}
Note that \(r'(1)\) is negative as the distance between the red train and the station is decreasing at 1 pm. Furthermore, from (18.1) it follows that
\begin{align*}
d(1) \amp = \sqrt{r(1)^2+b(1)^2}\\
\amp =\sqrt{1+1/16} \\
\amp = \sqrt{17}/4\text{.}
\end{align*}
Now, taking the derivative of both sides of (18.1), we see that
\begin{equation*}
2d(t)d'(t)=2r(t)r'(t)+2b(t)b'(t)\text{,}
\end{equation*}
and hence
\begin{equation*}
d'(t)=\frac{r(t)r'(t)+b(t)b'(t)}{d(t)}\text{.}
\end{equation*}
Finally, we compute
\begin{align*}
d'(1) \amp = \frac{r(1)r'(1)+b(1)b'(1)}{d(1)}\\
\amp = \frac{-50+100/4}{\sqrt{17}/4}\\
\amp = -\frac{100}{\sqrt{17}}\text{.}
\end{align*}
We conclude that at 1 pm, the distance between the two trains is decreasing at a rate of \(100/\sqrt{17}\) meters per second.