# The rate at which distance between ships change

I know this looks like a physics problem but its given in my maths question sheets so I am asking it here. Two ships A and B are sailing away from a fixed point O such that $AOB=120 ^\circ$ . At a particular instant OA is $8km$ and OB is $6km$ and ships A,B are sailing at $20km/hr,30km/hr$ respectively. Then the distance between them is changing at the rate (km/hr)?$$\text {Attempt}$$ I assumed B is moving along X axis and A is having motion in both directions . So at any time t the distance travelled by $B$ is $30t$ and that by A is $x=-10t,y=10\sqrt{3}t$ thus total distance between A and B is given by $d=\sqrt {{20}t^2}+10\sqrt {3}t$ .Now we want rate change so I differentiated it . But I am not sure if this is correct so wanted to verify and get idea on how to solve such problems.

Picture a $\triangle AOB$, and let the side opposite to $O$ have side length $o$. Using law of cosiness, we have $$o^2 = a^2 + b^2 -2ab \cos \angle AOB \tag {1}$$ To find rate of change of $o$, take the derivative with respect to time. Thus, $$2o \frac {do}{dt} = 2a\frac{da}{dt} + 2b\frac {db}{dt} -2[a \frac {db}{dt} + b \frac {da}{dt}]$$
Given: $a= 8, b=6, \frac {da}{dt} =20, \frac {db }{dt}=30$
From $(1)$, we can find $o$, and our result follows as $\boxed {\frac {260}{\sqrt {37}}}$. Hope it helps.
Alternative solution without derivatives. Let us assume that ship A runs along the $x$- axis and ship B runs along a line at $120^O$ in the second quadrant. Drawing the normal from $B$ to the $x$-axis and calling $C$ the foot, we get that, at the instant in which $OA$ is $8$ Km and $OB$ is $6$ Km, the right triangle $ABC$ has $$CA=CO+OA= 8+6/2=11$$ and $$CB=OB/2 \sqrt {3} =3\sqrt {3}$$ So the distance $AB$ between the ships is $$\sqrt {11^2+(3\sqrt {3})^2}=2\sqrt {37}$$
After a time $t$, we have $$CA=(8+20t)+(6+30t)/2=11+35t$$ and $$CB=(6+30t)/2\,\sqrt {3}=3\sqrt {3}+15\sqrt {3} t$$ So the distance $AB$ between the ships is $$\sqrt {(11+35t)^2+(3\sqrt {3}+15\sqrt {3} t )^2}=2\sqrt {475t^2+260t+37}$$
$$\lim_{t \rightarrow 0} \frac {2\sqrt {475t^2+260t+37}-2\sqrt {37} }{t}=\frac {260}{\sqrt {37}}$$