I want to show with the energy method the uniqueness of the solution of the following initial and boundary value problem.
$\left\{\begin{matrix} u_{tt}=u_{xx}+f(x,t), & 0<x<L,t >0\\ u(x,0)=\phi(x), & 0 \leq x \leq L\\ u_t(x,0)=\psi(x), & 0 \leq x \leq L \\ u_x(0,t)-2u_t(0,t)=g(t) & , t \geq 0\\ u_x(L,t)+3u_t(L,t)=h(t), & t \geq 0 \end{matrix}\right.$
where $f: [0,L] \times [0,\infty) \to \mathbb{R}, \phi, \psi: [0,L] \to \mathbb{R}$ and $g,h: [0,\infty) \to \mathbb{R}$ given smooth and compatible with the problem functions.
I have supposed that the solution is not unique, i.e. that there are $u_1,u_2$ that satisfy the problem. Then $w=u_1-u_2$ satisfies the following problem
$\left\{\begin{matrix} w_{tt}=w_{xx}, & 0<x<L,t >0\\ w(x,0)=0, & 0 \leq x \leq L\\ w_t(x,0)=0, & 0 \leq x \leq L \\ w_x(0,t)-2w_t(0,t)=0 & , t \geq 0\\ w_x(L,t)+3w_t(L,t)=0, & t \geq 0 \end{matrix}\right.$
After making some operations, we get that
$$\frac{d}{dt} \left[ \frac{1}{2} \int_0^L (w_t^2+w_x^2)(x,t) dx\right]=-3w_t^2(L,t)-2w_t^2(0,t)$$
We set $E(t)=\frac{1}{2} \int_0^L (w_t^2+w_x^2)(x,t) dx$ as the energy of the system.
But how do we know that $\frac{1}{2} \int_0^L (w_t^2+w_x^2)(x,t) dx$ is positive?
Also why does $E(t)=0$ imply that $w_t^2+w_x^2=0$ ? Couldn't we also get elsewhise that $E(t)=0$?
$E(t)$ is an integral over a non-negative function, because $w_t^2 \geq 0$ and $w_x^2 \geq 0$ (squares!!), so $E(t) \geq 0$ must hold.
The answer to the second question is also simple: If you have an integral over a non-negative function, and the integral is zero, also the function has to be zero almost everywhere. (Because, assume it would not be zero almost everywhere, then it cannot be negative, so it has to be positive on a set of measure greater than zero. But then, then integral can only be strictly larger than zero). These are both basic properties of the integral that you probably won't have to prove in detail.