A result in the solution of wave equation 
Let $u$ be a smooth solution of the initial-value problem
  $$
\left\{
\begin{aligned}
u_{tt} - u_{xx} &= 0\qquad \text{in}~ \mathbb{R}\times (0,\infty)\\
u=g,\quad u_t&=h\qquad \text{on}~\mathbb{R}\times \{t=0\}
\end{aligned}
\right.
$$
  Suppose that $g$ and $h$ are sufficiently smooth and have compact supports. \
  Define $p(t) := \frac{1}{2} \int\limits_{-\infty}^\infty u_x(x,t)^2\,d x \quad\text{and}\quad k(t) := \frac{1}{2}\int\limits_{-\infty}^\infty u_t(x,t)^2\,d x\,.$
  
  
*
  
*Prove that $E(t):= k(t) + p(t)$ is constant in $t\geq 0$.
  
*Prove that $p(t)=k(t)$ for all large enough times $t$.  

My Attempt: 
For the part 1, I was trying to prove that $\frac{d}{dt}E(t)=0$.
Hence we have, 
\begin{align}
E^{'}(t)&=k^{'}(t)+p^{'}(t)\\
&=\int\limits_{-\infty}^\infty u_x.u_{xt}+\int\limits_{-\infty}^\infty u_t.u_{tt}\\
&=\int\limits_{-\infty}^\infty  u_x.u_{xt}+\int\limits_{-\infty}^\infty u_t.u_{xx}
\end{align}
But after that what should I do.. 
Also for part 2, I know that from the D'Alambert's Formula, we have $$u(x,t)=\frac{1}{2}[g(x+t)-g(x-t)]+\frac{1}{2}\int\limits_{x-t}^{x+t}h(y)dy \tag{1}$$
So I'm trying to prove that when $t\to\infty$, $p(t)-k(t)=\frac{1}{2}\int\limits_{-\infty}^{\infty}u_x^2-u_t^2=0$. But I'm having a hard time in differentiating $(1)$ to get the suitable values.
Appreciate your help
 A: We have according to D'Alambert's formula
$$\lim_{x\to\pm\infty}u_t(x,t) \to \frac{1}{2}\left( g'(\pm \infty)+g'(\pm\infty)\right) + \frac{1}{2}\left(h(\pm\infty)+h(\pm\infty)\right) = 0$$
by the compact support of $g$ and $h$. Using this, we can pick up where you left off and show that
$$E'(t) = \int_{-\infty}^\infty u_x u_{tx}\:dx + \int_{-\infty}^\infty u_t u_{xx}\:dx = u_xu_t\Bigr|_{-\infty}^\infty -\int_{-\infty}^\infty u_t u_{xx}\:dx+\int_{-\infty}^\infty u_t u_{xx}\:dx = 0 $$
hence $E(t)$ is constant. For the second part, use D'Alembert's formula to get equations for the first partial derivatives:
$$u_t(x,t) = \frac{1}{2}\left( g'(x+t)+g'(x-t)\right) + \frac{1}{2}\left(h(x+t)+h(x-t)\right)$$
$$u_x(x,t) = \frac{1}{2}\left( g'(x+t)-g'(x-t)\right) + \frac{1}{2}\left(h(x+t)-h(x-t)\right)$$
$$\frac{1}{2}\int_{-\infty}^\infty u_t^2 - u_x^2 \:dx = \frac{1}{2}\int_{-\infty}^\infty(g'(x+t)+h(x+t))\cdot(g'(x-t) + h(x-t))\:dx$$
The question, however, does not ask for a limiting behavior of $t$. It implies a discrete switching behavior that happens for some finite $t$.
Taking a look at the integral, notice that if $t > |\operatorname{Supp}(g+h)|$, then for any point $x$ in the domain of integration, one of the terms in the integrand's product will always be $0$
Thus there exists $T = |\operatorname{Supp}(g+h)|$ such that $\forall t > T$:
$$k(t) - p(t) = \frac{1}{2}\int_{-\infty}^\infty u_t^2 - u_x^2 \:dx = 0$$
Physically, the first part demonstrates the conservation of energy, taking $k(t)$ to be kinetic energy and $p(t)$ to be potential energy. The second part demonstrates the principle of least action since the quantity $k(t) - p(t)$ is called the Lagrangian.
