# Optimization with time and derivatives

I have no idea at all how to do this problem, like most problems in my book, I do not even know where to begin.

A boat leave a dock at 2 PM and travels due south at a speed of 20 km/j. Another boat has been heading due east at 15 km/h and reaches the same dock at 3. At what time were the two boats closest together?

I have no idea at all on how to set this up. I know that I need to use the pythagoren theorem but that is all I know.

-
Why don't you start by making a drawing of the course of each boat? – Raskolnikov Apr 3 '12 at 10:46
I did and I found a triangle basically but that didn't help me. – user138246 Apr 3 '12 at 10:47

The following follows the same outline as the solution of Johannes Kloos. I am writing it out to make a point about the function we minimize.

Please read the solution below. Then, without looking at it any more, write out a solution. If it turns out you need to look at the solution again, do so. But then wait a few hours before writing out your solution, again without looking at what is written below.

Let the dock be at $(0,0)$, and use the familiar conventions for the direction of North, South, West, and East. It is convenient to let $t=0$ at $2:00$ PM, and adjust the answer to "real" time at the end.
So at time $t$ the position of the South-heading boat is $(0,-20t)$. (If you prefer, you can let $t=0$ at $12:00$ Noon. That changes the details a little.)

The position of the East-heading boat at time $t$ is of the shape $(15t+c, 0)$ for some constant $c$. Since its position at time $t=1$ ($3:00$ PM) is $(0,0)$, we have $(15)(1)+c=0$, so $c=-15$.

By the Pythagorean Theorem, or the formula for distance between two points, the square of the distance between the two boats at time $t$ is $(-20t)^2 +(15t-15)^2$. So the distance between the two boats is $\sqrt{(-20t)^2 +(15t-15)^2}$.

This is what we want to minimize. But first note the following. (a) The first boat was at the dock, maybe for several days, before setting out. So the expression for the distance is only valid for $t \ge 0$. And since we don't know what the second boat does after reaching the dock, we have $t \le 1$. (b) To minimize the distance, it is enough to minimize the square of the distance. So instead of working with the ugly expression with the square root, we minimize the much nicer expression for the square of the distance.

Let $F(t)=(-20t)^2+(15t-15)^2$. We want to minimize $F(t)$, subject to $0 \le t\le 1$. It is worthwhile to simplify $F(t)$ a little. We have $$F(t)=400t^2+225(t-1)^2.$$ It follows that $$F'(t)=(400)(2)(t)+(225)(2)(t-1).$$ This is $0$ when $t=\frac{9}{25}$.

It is not hard to verify that for $t<\frac{9}{25}$, the derivative is negative, and for $t>\frac{9}{25}$, the derivative is positive. So $F(t)$ is minimized at $t=\frac{9}{25}$. Or else (more work) we can calculate $F(0)$, $F(1)$, and $F(9/25)$, and compare.

So the minimum distance is reached $\frac{9}{25}$ hours after $2:00$ PM. The minimum distance turns out to be $12$.

-
I do not know what you mean by real time and by 20t and such. – user138246 Apr 3 '12 at 22:32
@Jordan: We are presumably measuring time in hours. Hours from when? I chose hours from $2:00$. But if we choose hours from $12:00$ noon, we would have to replace $t$ in the basic formula by $t-2$. The speed of the first boat is $20$ (mph), so in time $t$, it travels a distance of $20\times t$, abbreviated as usual as $20t$. Since it is travelling South (downwards), its $y$-coordinate at time $t$ is $-20t$. It is going due South, so its $x$-coordinate stays at $0$, and therefore its position at time $t$ is $(0,-20t)$. Similar but more complicated calculation for the other boat. – André Nicolas Apr 3 '12 at 22:39
I attempted the problem but I somehow got the math wrong and ended up with nonsense. – user138246 Apr 3 '12 at 23:02
I tried it again just by following what you did and I was able to get the proper answer. – user138246 Apr 3 '12 at 23:15

An outline of an approach:

1. Choose a good coordinate system (e.g., put the dock at $(0,0)$, let $(1,0)$ denote 1km south of the dock and $(0,1)$ 1 km east).
2. Find functions describing the position of the boats at time-point $t$ (you can work with linear functions here, e.g. $(x_1(t), y_1(t))$ for the position of boat 1, $(x_2(t), y_2(t))$ for the position of boat 2).
3. Find a function $d(t)$ describing the distance of the boats, in terms of the functions of step 2 (the Pythagorean theorem comes in here).
4. Find the minimum of the distance function (using differentials, for example).
-
I don't actually know how to do any of those steps. – user138246 Apr 3 '12 at 22:30