Particle A moves along the positive x-axis, and particle B along the line $$y=-\sqrt{3}x$$ for $x\in\left(-\infty,0\right]$ where $x$ and $y$ are in meters. At a certain time, $A$ is at the point $\left(5,0\right)$ and moving with speed $3\textit{ ms}^{-1}$, and $B$ is at a distance of $3$ units from the origin and moving with speed $4\textit{ ms}^{-1}$ away from the origin. At what rate is the distance between $A$ and $B$ changing?
My approach: I tried to write relative position/velocity vectors for both $A$ and $B$ at the instant, and got them to be: $$\vec{r_{A,B}}=\frac{13}{2}\hat{i}-\frac{3\sqrt{3}}{2}\hat{j}$$ and $$\vec{v_{A,B}}=5\hat{i}-2\sqrt{3}\hat{j}$$All I know from here is that $v_{A,B}=\dot{r_{A,B}}$ w.r.t. time.
I would appreciate any help. Thanks a lot!
Let $r$ be the distance away from the origin along the line $y=-\sqrt{3}x$ and let $d$ be the distance between the points $A$ and $B$.
By the law of cosines $$d^2=r^2+x^2-2rx\cos{120^{\circ}}=r^2+x^2+rx$$
Plugging in $r=3$ and $x=5$ gives $$d^2=3^2+5^2+3(5)=49\implies d=7$$
Differentiating gives $$2d\frac{dd}{dt}=2r\frac{dr}{dt}+2x\frac{dx}{dt}+r\frac{dx}{dt}+x\frac{dr}{dt}$$ and evaluating at $r=3, x=5, d=7$ and the speeds of $A$ and $B$ gives $$14\frac{dd}{dt}=6(4)+10(3)+3(3)+5(4)=83\implies\frac{dd}{dt}=\frac{83}{14}$$