How to derive the hamiltonian from a non-classical lagrangian For the non-classical lagrangian of a hydrogen atom:
$$L = -mc^2 \sqrt{1-\frac{v^2}{c^2}} + \frac{e^2}{4 \pi \epsilon r}$$
We get that two conserved quantities are:
$J = \gamma mr^2 \dot{\phi}$ and $E = \gamma mc^2 - \frac{e^2}{4 \pi \epsilon r}$, where $\gamma = \frac{1}{ \sqrt{1-\frac{v^2}{c^2}}}$ and $v^2 = \dot{r} + r^2\dot{\phi^2}$
In trying to eliminate $\dot{r}$ and $\dot{\phi}$, I just keep going around in circles because $\gamma$ contains both  $\dot{r}$ and $\dot{\phi}$ - how can I get around this? Any direction would be greatly appreciated.
EDIT:
I think I was able to do it, but my expressions for $\dot{r}$ and $\dot{\phi}$ are so disgusting, I don't even know if how to check whether it is correct.
Is there some sort of trick to this that makes it easier?
Thanks! 
 A: I think it goes like this:
\begin{align} 
p&=m\dot r \left(1-\dfrac{\dot r^2+r^2 \dot\phi^2}{c^2}\right)^{-1/2}, \\
p_\phi &= mr\dot\phi \left(1-\dfrac{\dot r^2+r^2 \dot\phi^2}{c^2}\right)^{-1/2}.
\end{align}
You get: 
$$\dfrac{m\dot r}{mr \dot\phi}=\dfrac{p}{p_\phi}.$$
You can use this last equation in order to obtain $\dot \phi$ in terms of $p$ and $p_\phi$. How? If $\dot r =pr\dot\phi/p_\phi$, then:
$$mr\dot\phi \left(1-\dfrac{(pr\dot\phi/p_\phi)^2+r^2 \dot\phi^2}{c^2}\right)^{-1/2}=p_\phi,$$
with some algebra you get:
$$\dot\phi^2=\dfrac{p_\phi^2 c^2}{m^2 c^2 r^2 +\dfrac{p^2r^2}{p_\phi^2}+r^2}.$$
You can find $\dot r$, which is equal to:
$$\dot r^2=\dfrac{p^2 c^2}{m^2 c^2+\dfrac{p^2}{p_\phi^2}+1}.$$
The hamiltonian is:
$$H=\dot r \dfrac{\partial L}{\partial \dot r}+\dot \phi \dfrac{\partial L}{\partial \dot \phi}-L(r,\dot r,\dot \phi).$$
As you can see, $\dot \phi$ and $\dot r$ are in the hamiltonian, and $\dot \phi^2$ and $\dot r^2$ are under a square root. It's not pretty, but I will leave the rest to you.
