after 9:00 P.M. 24 minutes boats were closet together.
Converting speed into km/min
20/60 = (1/3) km/min
15/60 = (1/4) km/min
first boat distance from the dock is d=1/3 km each minute
Second boat distance from the dock reduced by each minute is
D = 15 - (1/4) * t
d^2 + D^2
= (1/9) * t^2 + (15 - 1/4 * t) ^2
= (1/9) * t^2 + 225 - (30/4) *t + (1/16) t^2
After derivation we get
t=24 minutes