# Why internal energy in Lagrangian is treated as a potential energy?

To obtain Euler fluid equations of motion one can do variational principle on the following Lagrangian density where $$\rho_0$$ is reference density, $$\Phi$$ is displacement vector field and $$u$$ is internal energy density.

$$\mathcal{L} = \frac{1}{2}\rho_0 \left( \frac{\partial \Phi}{\partial t} \right)^2 - \rho_0 u$$

This model (Euler fluid + thermodynamics) is supposed to work for ideal gas as well. For that we know that internal energy is assumed to be consisting only of average kinetic energy of individual gas particles. But we know that in inertial reference frame Lagrangian has the following form where $$K$$ is kinetic energy density and $$U$$ is potential energy density.

$$\mathcal{L} = K - U$$

How to explain that even though internal energy is average kinetic energy, in Lagrangian it is with negative sign which can be interpreted as internal energy being potential energy of some sort?

In a nutshell this is because the corresponding kinetic energy in this model is not represented via time-derivatives of the dynamical variables of the systems. If you allow me to use an oversimplified argument, intuitively, the Hamiltonian represents the total energy $$H~=~T+V ,$$ where all the various energy contributions are added up. Then, after a Legendre transformation, typically the Lagrangian takes the form $$L~=~T-V$$ with a minus, even if $$V$$ in principle represents some kind of kinetic energy.
• Sorry, I should have clarified. I am interested in going from discrete $N \gg 1$ particles to continuous variational principle. If you do Lagrangian mechanics for discrete particles then for "ideal gas" you have only kinetic energy and no potential energy. Also, you know $L = T-V$ so you might think that internal energy is with $+$ sign. As we already discussed, this is not the case. So, is it a better idea to writing Hamiltonian for $N$ particles and then approximating it with smooth functions (if we have $M$ cells then center of mass coords transform to displacement field, ...) ? Jul 16 '19 at 23:50