Solution (source code)

= Solution

Differentiate the proposed energy and integrate the kinetic term by parts:
$$
\frac d{dt}E(u(t))
=\int_{\mathbb R}(-u_{xx}-u^p)u_t\,dx.
$$
Putting $F=u_{xx}+u^p$, the equation says $u_t=-F_x$, so
$$
\frac d{dt}E(u(t))
=\int_{\mathbb R}F F_x\,dx
=\frac12\int_{\mathbb R}\partial_x(F^2)\,dx=0.
$$
Hence <KdV energy conservation> gives
$$
\boxed{E(u(t))=E(u_0)}.
$$