Suppose there is a Lagrangean $L = \frac{1}{2} m c \dot x - \frac{1}{2}kx^2$ where $c$ is a constant to keep the dimensions right.
The conjugate momentum is then $ p_x = \frac{\partial L} {\partial \dot x} = \frac{1}{2}mc$ which is independent of $\dot x$. So, apparently there is a difficulty of writing $\dot x = \dot x (p_x, x)$. Then how do I use the Legendre transformation $ H = p_x \dot x - L$ to get the Hamiltonian?
This might seem like a unphysical situation. But on chapter 13,vproblem 4 on Classical Mechanics, 3rd edition, Goldstein, Poole, Safko there is a similar example. Given the Lagrangean density $$\mathcal{L} = \frac{h^2}{8 \pi^2 m} \nabla\psi \cdot \nabla\psi^* + V \psi^* \psi + \frac{h}{4 \pi i} (\psi^* \dot \psi - \psi \dot \psi ^*)$$
When you try to calculate the conjugate momenta for $\psi$, you get $\pi_{\psi} = \frac{\partial \mathcal{L}} {\partial \dot \psi} = \frac{h}{4 \pi i} \psi^*$ which is independent of $\dot \psi $ or $\dot \psi^*$. So, apparently there is a difficulty of writing $\dot \psi = \dot \psi(\pi_\psi, \pi_{\psi^*}, \psi, \psi^*)$.
Then how do I perform the Legendre transformation from Lagrangean density $\mathcal{L}$ to Hamiltonian density $\mathcal{H}$?