Solution (source code)

= Solution
{c}

Continue with $f=p\sin\phi$ and $q=p\cos\phi$. The <tangent vector> to the hoop is $\mathbf r_\phi=f'\mathbf e_1-q'\mathbf e_3$. Smooth contact means that the hoop's <normal force> has zero <dot product> with this <tangent vector>. The remaining applied force is $-mg\mathbf e_3$, whose <dot product> with $\mathbf r_\phi$ is $mgq'$.

Since $\boldsymbol\omega=\omega\mathbf e_3$, the <Coriolis force> is perpendicular to the hoop's <plane> and hence to $\mathbf r_\phi$. Also
$$
\boldsymbol\omega\times(\boldsymbol\omega\times\mathbf r)=-\omega^2f\mathbf e_1.
$$
Take the <dot product> of the rotating-frame <Newton's second law> with $\mathbf r_\phi$, substitute <6/a>, and divide by $m$:
$$
(f'^2+q'^2)\ddot\phi+(f'f''+q'q'')\dot\phi^2-\omega^2ff'=gq'.
$$
Define
$$
K=f'^2+q'^2,\qquad J=-\frac12\omega^2f^2-gq.
$$
Then $K'/2=f'f''+q'q''$ and $J'=-\omega^2ff'-gq'$, so
$$
\boxed{K(\phi)\ddot\phi+\tfrac12K'(\phi)\dot\phi^2+J'(\phi)=0.}
$$
Expanding the squares makes the cancellation of the mixed terms explicit:
$$
\boxed{K(\phi)=(p'\sin\phi+p\cos\phi)^2+(p'\cos\phi-p\sin\phi)^2=(p')^2+p^2>0.}
$$
The strict <inequality> follows from $p>0$. Here $J$ is the <rotating-frame effective potential> per unit <mass>. Multiplication of the <equation> by $\dot\phi$ gives the useful first <integral> $\tfrac12K(\phi)\dot\phi^2+J(\phi)=\text{constant}$.