Answer
Cart B is moving toward point Q at a speed of $~~0.867~ft/s$
Work Step by Step
Let $L$ be the length of rope between cart A and pulley P.
Let $a$ be the distance between cart A and point Q.
$L^2 = a^2+12^2$
$L = \sqrt{a^2+144}$
$(39-L)$ is the length of rope between cart B and pulley P.
Let $b$ be the distance between cart B and point Q.
$b^2+12^2 = (39-L)^2$
$b^2+144 = (39- \sqrt{a^2+144})^2$
$b^2 = (39- \sqrt{a^2+144})^2-144$
$b^2 = (39- \sqrt{5^2+144})^2-144$
$b^2 = (39- 13)^2-144$
$b^2 = 532$
$b = 23.065$
We can find $\frac{db}{dt}$:
$b^2 = (39- \sqrt{a^2+144})^2-144$
$2b~\frac{db}{dt} = 2(39- \sqrt{a^2+144})(-\frac{2a}{2~\sqrt{a^2+144}})(\frac{da}{dt})$
$\frac{db}{dt} = (\frac{1}{b})(39- \sqrt{a^2+144})(-\frac{2a}{2~\sqrt{a^2+144}})(\frac{da}{dt})$
$\frac{db}{dt} = (\frac{1}{23.065})(39- \sqrt{5^2+144})(-\frac{(2)(5)}{2~\sqrt{5^2+144}})(2)$
$\frac{db}{dt} = -0.867~ft/s$
Cart B is moving toward point Q at a speed of $~~0.867~ft/s$