The pseudo force equation is
$$\vec F_p=-2\,m\,(\vec \omega\times \vec v)-m\,(\vec\omega\times (\vec\omega\times \vec R))$$
where $~\vec v=\dot{\vec{R}}$ and $~\vec\omega=\text{const.}$
the pseudo force is depending on the generalized coordinates $~\vec q~$ and the generalized velocities $~\dot{\vec{q}}$
If we applied the Euler-Lagrange to obtain the equations of motion, the pseudo force is external force , but instead we can use potential energy with this Lagrange function
$$\mathcal{L}(~\vec q~,~\dot{\vec{q}})=\frac m2\,\vec{v}\cdot \vec{v}-U_p\\ U_p=m\,(\vec\omega\times\vec v)\cdot \vec R-\frac m2 (\vec\omega\times\vec R)\cdot (\vec\omega\times\vec R)$$
my question is what is the mathematical derivation to obtain the pseudo force potential $~U_p$?