your friend left his home 2 hours ago and cycles due north at 30 km/h. you have been cycling due west at 20 km/h and arrives at his home now. At what time were the two of you closest to each other?

at time t hours, the distance z is

z^2 = (40-20t)^2 + (30t)^2

now just find when dz/dt = 0

the friend's distance north is 30 t

your distance east is ... 40 - 20 t

it's a right triangle

use Pythagoras to find the hypotenuse
... which is the distance

find the minimum - with respect to t

To find the time when the two of you were closest to each other, we first need to determine their relative distance at any given time. Since you have been cycling due west and your friend has been cycling due north, the distance between you can be calculated using the Pythagorean theorem.

Let's assume that the starting point of your friend is the origin (0,0) on a coordinate plane, and you started 2 hours later at point (40,0), as you were cycling at 20 km/h.

The equation for your friend's position is x = 0 (since he is moving north).

The equation for your position would be x = 40 - 20t (where t represents the time in hours).

To find the distance between your friend and yourself at any time t, we can calculate the distance using the Pythagorean theorem:

d^2 = (0 - (40 - 20t))^2 + (0 - 30t)^2
= (40 - 20t)^2 + (30t)^2

Now, we need to find when the distance is minimized. To do so, we can take the derivative of the equation d with respect to t and set it equal to zero:

d' = 2(40 - 20t)(-20) + 2(30t)(30)
= -40(40 - 20t) + 60t^2
= -40(40) + 800t + 60t^2
= -1600 + 800t + 60t^2

Setting d' equal to zero:

-1600 + 800t + 60t^2 = 0

Now we can solve this quadratic equation to find the time t when the distance between you and your friend is minimized.

Once we have the value of t, we can calculate the actual time by adding 2 hours, as your friend started 2 hours before you.