Lagrangian potential for Newtonian gravity In the Wikipedia site for Lagrangian (field theory) the Lagrangian density for Newtonian gravity is given by
$${\cal L}(\mathbf{x},t) = \frac{1}{2}\rho(\mathbf{x},t)\mathbf{v}^2  -\rho(\mathbf{x},t) \Phi(\mathbf{x},t) – \frac{1}{8\pi G}(\nabla\Phi(\mathbf{x},t))^2$$
I understand how variation of this Lagrangian leads to the correct Poisson equation $\nabla^2\Phi=4πG\rho$.
However, if ${\cal L}$ is simply the differential form of $T-V$, I  would have thought that just the first two terms would be sufficient.  Where does the third term in ${\cal L}$ come from?
 A: The last term represents the energy that is carried in the gravitational field itself. If you are familiar with electrostatics, this would be the equivalent of the statement that the energy stored in an electric field is $\frac{1}{2}\epsilon|\mathbf{E}|^2=\frac{1}{2}\epsilon(-\nabla V)^2$, where $V$ is the electric potential (the electric equivalent to $\phi$).
A: TL;DR: JoshuaTS' answer is exactly right: (Minus) the 3rd term ${\cal V}_3=\frac{1}{8\pi G}(\nabla\Phi)^2$ is the energy density of the gravitational field.

*

*In total OP's Lagrangian density contains 3 terms: ${\cal L}={\cal T}_1-{\cal V}_2-{\cal V}_3$. Here ${\cal T}_1$ is a kinetic term for matter, while ${\cal V}_2=\rho\Phi$ is an interaction/source term between matter and the gravitational field.


*The EL equation for the specific gravitational potential $\Phi$ is the Poisson eq. $\nabla^2\Phi=4\pi G \rho$, as OP already mentions.


*Next let us integrate out/eliminate the $\Phi$-field by using its EL equation. Then one may show that ${\cal V}_3=-\frac{1}{2}{\cal V}_2$, so the 3rd term is important for the correct normalization of the potential energy.


*In fact, it's a fun exercise to check that if the mass density $$\rho({\bf x},t)=\sum_i m_i \delta^3({\bf x}-{\bf x}_i(t))$$ is a sum of point masses, then the  potential energy
$$V~=~\int_{\mathbb{R}^3}\!d^3x~({\cal V}_2+{\cal V}_3)~=~- \frac{G}{2}\sum_{i\neq j} \frac{m_im_j}{|{\bf x}_i(t)-{\bf x}_j(t)|}$$
becomes Newton's gravitational formula after discarding the singular self-interaction terms.
