This can be considered the two balls and the rope this system, the straight direction of the force, only the horizontal rod on the ball A support force and the gravity of the AB ball, so the support force FA = 2mg, friction f = 2μmg
You can calculate the distance upward of the B ball, right?AB distance remains unchanged, upward OB is 3, you can know that the displacement of the B SB = 1m
The Tensile force F doing work M=f×1+mg×1=. Calculation should be 14J
(2) AB accelerated motion, you can not use the balance of forces in (1), and can not calculate the friction.
Then you have to use the work done by F minus the AB increase in mechanical energy, by the speed of A, you can calculate the speed of B, this is the speed of decomposition or with the instantaneous center, the speed of B should be 4VA / 3, B rise distance or 1m, the rest of you can calculate it.
Q=20×1-? ×2?-? × (8/3)? -10=4.44J