Solution (source code)

= Solution

Take the natural release interpretation: both block and bob are initially at rest, the block starts at $x_0$, and the bob has small horizontal displacement $\delta=l\theta_0$ relative to the downward line through the pivot. Then $P=0$, $\dot\theta(0)=0$ and
$$
\boxed{\theta(t)=\theta_0\cos\Omega t,\qquad
x(t)=x_0+\frac{m\delta}{M+m}(1-\cos\Omega t).}
$$
The bob's horizontal <position> is
$$
X(t)=x(t)+l\theta(t)=x_0+\frac{m\delta}{M+m}+\frac{M\delta}{M+m}\cos\Omega t.
$$
The block and bob therefore oscillate in opposite phase about the fixed horizontal <centre of mass> $x_0+m\delta/(M+m)$. Their horizontal oscillation amplitudes are $m\delta/(M+m)$ and $M\delta/(M+m)$ respectively. They pass the centre-of-mass line together when the rod is vertical. If the bob were also given an unspecified initial <velocity>, the additional sine and translational terms in part (d) would be needed; the source's displacement-release case selects the cosine solution.