TITLE: Heat Equation - Energy (Neumann Condition)
QUESTION [6 upvotes]: Consider the heat equation
\begin{equation}
u_t - u_{xx} = 0, \  \ \ x \in [0, L],\  t > 0.
\end{equation}
and
\begin{equation}
E(t) = \int^L_0 (u(x,t))^2 dx.
\end{equation}
If $u$ satisfies the neumann condition $u_x(0, t) = u_x(L, t) = 0$, show that $E(t)$ is constant.
Attempt: Integrating by parts, we have
\begin{equation}
\frac{1}{2}E'(t) = \int^L_0 uu_t dx = \int^L_0 uu_{xx} dx = uu_x|^L_0 - \int^L_0 u_x^2 dx. 
\end{equation}
Integrating the term $\int^L_0 u_x^2 dx$ by parts, i arrive at the same place. Help!

REPLY [6 votes]: $E(t)$ is indeed non-constant: e.g.
$$ u(x, t) = \exp \left(-\frac{\pi^2t}{L^2}  \right) \cos \left( \frac{\pi x}{L}\right)$$
satisfies the heat equation $u_t = u_{xx}$ and
$$ u_x ( 0, t) = u_x (L, t) = 0,$$
but
$$E(t) = \int_0^L u^2(x, t)dx = \exp \left(-\frac{2\pi^2t}{L^2}  \right)\int_0^L \cos ^2\left( \frac{\pi x}{L}\right) dx  $$
is not constant in $t$. What you can show is only that $E(t)$ is non-increasing (as you did).