6. A metal ball of mass m with a hole through it is threaded on a frictionless vertical rod.
A massless string of length l is attached to the ball, runs over a massless, frictionless
pulley, and supports a block of mass M, as shown in the figure. The distance between
the rod and the pulley is b. Note that the positions of the two masses can be specified
by a single angle $\theta$.
(a) Find the potential energy as a function of $\theta$, $U = U(\theta)$. Assume that the pulley
and the ball have negligible size.
(b) Find whether the system has an equilibrium position. Consider the cases $m >$
M; $m = M$, and $m < M$. Discuss the stability of any equilibrium position.