# An extra term in the calculation of Newton's gravity energy density [duplicate]

The lagrangian density of a newtonian gravity is:

$$\mathcal{L} = -\rho \Phi - (\nabla \Phi)^2$$

up to certain constants. I made analogies with electrostatics and I believe that the energy density of the field should depend on $$(\nabla \Phi)^2 = (\vec{g})^2$$ like the $$\vec{E}^2$$ in electrostatics.

While calculating the hamiltonian density, I got no conjugate momenta so the hamiltonian density came out like:

$$\mathcal{H} = - \mathcal{L} = \rho \Phi + \vec{g}^2$$

I recognize the last term as the term I want. What about the first term $$\rho \Phi$$? I interpreted this as the energy density of the particles in a potential but shouldn't the term $$\vec{g}^2$$ account for everything? Doesn't this mean that in electrostatics, the energy density should be $$\rho \Phi + \vec{E}^2$$ as well?

• Possible duplicate: physics.stackexchange.com/q/571070/2451 Commented Aug 19, 2023 at 0:26
• Just because you derive a valid Hamiltonian density or some Noether conserved quantity it does not mean it is also equal to established definition of energy density/that conserved quantity in physics (e.g. $\frac{1}{2}(E^2+B^2)$ in case of macroscopic EM field theory, or $\frac{1}{2}g^2$ in Newtonian theory of gravity of regular density distributions). Similarly for the entire tensor of energy-momentum or angular momentum. Difference occurs already for some Lagrangians in classical mechanics, such as energy of a particle on a rotating constraint, damped harmonic oscillator, etc. Commented Aug 19, 2023 at 1:04