How to show NLS conserves the energy?

Consider nonlinear Schrodiner equation (NLS):

$$i\partial_t u + \Delta = \pm |u|^{p-1}u, u(x,0)=u_0 \in H^1(\mathbb R^d)$$
where $u:\mathbb R^{d+1} \to \mathbb C, u_0:\mathbb R^d \to \mathbb C, 1<p<\infty.$

We put $$E(u(t))= \frac{1}{2} \int_{\mathbb R^d} |\nabla u (x,t)|^2 dx \pm \frac{1}{p+1} \int_{\mathbb R^d} |u(x,t)|^{p+1} dx.$$

My Question: How to show $E(u(t))= E(u(0))$ for all $t\in \mathbb R$? References is also OK, if I can found the solution of this fact in it.

Motivation: I am trying to following equation (3) in the lecture note,see also exercise 1 in the same note.

Solutions Collecting From Web of "How to show NLS conserves the energy?"

It suffices to show that $$\frac d{dt} E(u(t)) = 0.$$

Start by moving the time derivative inside the integrals, which gives (using the product and chain rules)

$$\frac d{dt} E(u(t)) = {\rm Re}\int \nabla \partial_t u \cdot \nabla \bar u \pm {\rm Re}\int|u|^{p-1}\bar u \ \partial_t u$$

Assuming some kind of decay condition at infinity we can integrate by parts in the first integral to get $-{\rm Re}\int\partial_t u \ \Delta \bar u$, so substituting $\partial_t u$ using the evolution equation we get

$$\begin{align}\frac d{dt} E(u(t)) &= {\rm Re}\int (i \Delta u \mp i |u|^{p-1} u)( -\Delta \bar u\pm |u|^{p-1}\bar u)\\
&= {\rm Re}\left[\int i|\Delta u|^2 – \int i|u|^{2(p-1)}u \bar u\ \pm\int i\left(\Delta u |u|^{p-1}\bar u +\Delta \bar u |u|^{p-1}u\right)\right].
\end{align}$$

All three integrals here are purely imaginary and thus their real parts vanish, so we have the desired result.