I am trying to find the Lagrangian $L$ of a system I am studying. The equations of motion is:
$$\left\{ \begin{array}{c l} r \ddot{\phi} + 2\dot{r} \dot{\phi}+k(r) \cdot r \dot{r} \dot{\phi} = 0\\ \ddot{r} - r \dot{\phi}^2 - k(r) \cdot r^2 \dot{\phi}^2 = 0 \end{array}\right.$$
I have tried a general Ansatz $L=L_1+L_2=\Sigma_{m,n,p,q} C_{m,n,p,q} r^m \dot{r}^n \phi^p \dot{\phi}^q+L_2(k(r))$ and plugged into the Euler-Lagrange equation but find the calculation extremely tedious. Is there some systematic way to find it?
I'd really appreciate any hints. Thank you!