Let $u_{tt}=u_{xx}$ in the strip $\{(x,t):0\leq x \leq \pi, t \geq 0\}$ with boundary conditions $u_x(0,t)=k_0u(0,t)$ and $u_x(\pi,t)=k_1u(\pi,t)$. I am asked to prove that $E=\frac{1}{2}\int_0^\pi (u_t)^2+(u_x)^2dx$ is an integral of motion given constants $k_0,k_1.$
Following the example in the book where $u$ has compact support I differentiate with respect to $t$ and obtain $\frac{\partial}{\partial t}E = u_x(\pi)u_t(\pi)-u_x(0)u_t(0)= k_1 u(\pi)u_t(\pi)-k_0u(0)u_t(0).$ I can't see how this is supposed to be zero. In all other examples I have found, they put $u_t=0$ on the boundary.