TITLE: Where do some "energy identities" in PDE theory come from?
QUESTION [15 upvotes]: There are a lot of very complicated expression that helps us obtain useful estimates for PDEs. To just give one example, the following is one of the Virial identities:
$$
\frac12\frac{d}{dt} \Im \left(\int (x \cdot \nabla u) u^*  \right)dx =\int|\nabla u|^2 dx -\epsilon\left(\frac{n}{2}-\frac{n}{p+1}\right)\int|u|^{p+1} dx,
$$
where $u\in H^1, xu\in L^2$ solves the non-linear Schrödinger equation $i\partial_t u + \Delta u = -\epsilon u|u|^2$ in $\mathbb R^n.$
One way to come up with complicated "energy" or "momentum" expressions is to use Noether's theorem, but apparently many identities similar to the one above cannot be easily derived by Noether's theorem. In particular, the above expression can be derived without using any Lagrangians at all.
I often see such complicated identities in texts about PDE theory, stated and proven without any clues about where they come from.
My question is: how do people come up with them in the first place? It would be very helpful if there were an explanation for at least one or two identities like this so that I can see what type of reasoning is involved when we discover them.

REPLY [6 votes]: Another construction when your PDE has a Hamiltonian structure, but the Poisson structure has a non-trivial kernel. Roughly speaking, this means that the phase space is foliated by submanifolds, and each of these varieties is equiped with a non-degenerate Poisson structure, this one varying smoothly along the foliation. Functions that are constant along each leaf are called Casimir's. These are conserved quantities along the flow of the PDE because this flow stay on the leaf associated with the initial data.
A typical example arises in the Euler equation governing the velocity field $u$ of an incompressible fluid. In $2$ space dimensions, the functional
$$\int_\Omega f(\partial_1u_2-\partial_2u_1)\,dx$$
are Casimir's ($f$ smooth but arbitrary). In $3$ space dimensions, in a torus or in ${\mathbb R}^3$, the helicity is a Casimir:
$$\int u\cdot{\rm curl}\,u\,dx.$$
Both examples have natural generalizations to higher dimensions. They also have counterparts in the case of compressible fluids.
This is quite important because despite the family of Casimir's can be quite large, it does not contribute to the complete integrability of a Hamiltonian system. In some sense, these are trivial invariants, because they depend only upon the Poisson structure, but not on the choice of the Hamiltonian.