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$.
There are various ways of solving this. You should draw a picture of the
situation first.
One way is to model both ships as a line.
$p_A(0) = t(5,0), p_B(0) = {5\over \sqrt{2}}(1,1)+t (0,-4)$.
It is easier to work with the square of distance.
Now compute $s(t) = \|p_B(t)-p_A(t)\|^2 = \|{5\over \sqrt{2}}(1,1) +t(-5,-4) \|^2=
({5\over \sqrt{2}}-5t)^2 + ({5\over \sqrt{2}}-4t)^2 $.
Now differentiate, set it equal to zero and solve for $t$.
You will get $t = {45 \over 41 \sqrt{2}}$. Remember to convert to minutes.
Best Answer
Hint: You are given the derivatives of your functions!
Let $f(t), g(t)$ be defined as above. Let $d_{1}(t) := |f(t)|$ and $d_{2}(t) := |g(t)|$ The distance squared is $H(t) := d_{1}(t)^{2} + d_{2}(t)^{2}$. In this case, what you are given is $d_{1}'(t) = -15$ since the distance to the dock is decreasing and $d_{2}'(t) = 20$ for the "opposite" reason. This implies that $d_{1}(t) = -15t + c$ and $d_{2}(t) = 20t + d$ for some constants $c, d$. By putting $t = 0$, we see $d = 0$ and $c = 15$ (since it took exactly one hour to reach the dock). Now we got $H(t) = (-15t + 15)^{2} + (20t)^{2}$ and the task became a problem that you know how to solve!