What you have is a right triangle that starts with sides of 2 and 1
The intial distance between the cars is SQRT(22 + 12) = SQRT(5)
But the cars are moving so the sides of our right triangle are changing
One side equals (2 - 10t) where t is in hours
the other side equals (1 - 40t) t in hours
the distance D = SQRT((2-10t)2 + (1-40t)2)
expand the terms and simplfiy
D = SQRT( 4 - 40t + 100t2 + 1 - 80t + 1600t2)
D = SQRT(1700t2 - 120t +5) This is your distance function
now we want to find the point where the distance is at a minimum
we can use derivatives and set the deravitive to 0 to find the minimum
D = (1700t2 - 120t + 5)1/2
The derivative of this is
D' = (3400t - 120)/2(1700t2 - 120t + 5)1/2
This will be zero when th numberator is zero
So we set 3400t - 120 = 0
the minimum will be at t =120/3400 or t = .035294
you can try values of t larger and smaller than this number to see that in fact the cars are closest at that time.
Hope this helps
Paige C.
10/22/14