Why does centrifugal force contribute to potential energy? 
A ball of mass $m$ is moving inside a vertical hollow hoop with radius $L$ and with angular velocity $\omega$. 


I was asked to find a term for the total potential energy of the ball.
I found the term $u=mgL(1-cos\theta )$ for the gravitational potential energy, but why does the centrifugal force also contribute to it?
Any insights will be helpful.  Also, if I made any miscalculations please let me know.  Thanks.
 A: Since gravity pulls down the beam, hence gravity is also affecting how the hoop rotates; therefore something must give out energy, such that the hoop keeps rotating at a fixed rate. The only thing in the system can possibly give in energy is what keeps the whole thing rotating at a fixed rate. On the other hand, to see what role the "centrifugal force"  play, we need to find the equation of motion.
The Lagrangian is $$L=\frac{1}{2}m(\omega^2R^2\sin^2 \theta +R^2 \dot \theta) -mgR(1-\cos\theta)$$ 
Hence the E-L equation gives us: $$R\ddot\theta = \sin\theta(\omega^2R \cos \theta − g)$$
We can interpret this equation as: the gravitational acceleration ($g\sin\theta $) is in competition with centripetal acceleration along the hoop ($\omega^2R \cos \theta\sin\theta$) ; therefore, yeah, you "can" say there is centrifugal force gives the potential energy in a non-inertial frame.
After finding the equilibrium points, we will see there exist a critical frequency $\omega_c^2=g/R$ that will ultimately change the stable point. For a low frequency  $\omega$, the only stable point is at the bottom. Once we pick a frequency  $\omega$ larger than the critical frequency, the only stable point instantly jump to $\theta=\cos ^{-1}(\frac{g}{\omega^2R})$. It would be weird to say there exist centrifugal force, as it behaves so dramatically differently with a frequency just slightly higher. Indeed, centrifugal force is just what we use when we try to make sense of Newton's II law in a non-inertial frame. (centrifugal force is always not real -- but its effect is real)
A: Suppose there is no gravity in this situation. From the rotating frame of reference, there is an outward centrifugal force acting on the mass. In order to move the mass $m$ closer to the axis work must be done against the centrifugal force. Therefore the mass gains potential energy as it moves inwards, eg at the expense of its kinetic energy.
Centrifugal force is like another force of gravity, acting radially outwards instead of vertically downwards. Unlike gravity the centrifugal force increases with distance $r$ from the axis : it is $m\omega^2 r$. This is like a spring with constant $k=m\omega^2$, except that the force is in the same direction as the extension $(F=+kr)$ instead of the opposite direction $(F=-kr)$. 
Relative to the extreme points furthest from the axis, where $r=L$, the potential energy is  $$W=-\int_L^r F.dr = \int_r^L m\omega^2 r.dr = [\frac12 m\omega^2 r^2]_r^L = \frac12 m\omega^2(L^2-r^2)$$
