# Integration by parts in PDE: Where is my error?

I'm trying to understand the answer given here in detail. In particular, I have the problem:

$$\begin{cases} u_{tt} - u_{xx} &= 0 \ \ & \text{for} \ -\infty < x < \infty, \ 0 \leq t < \infty\\ u(x,0) &= \phi(x) \ \ & \text{for} \ -\infty < x < \infty\\ u_t(x,0) &= \psi(x) \ \ & \text{for} \ -\infty < x < \infty\\ \end{cases}$$

And I am trying to show that, for kinetic energey $$KE = \frac{1}{2}\int_{-\infty}^{\infty} u_t^{2} dx$$ and potential energy $$PE = \frac{1}{2} \int_{-\infty}^{\infty} u_x^{2} dx$$

$$KE + PE$$ is constant.

$$$$\frac{d}{d t}(Et) = \frac{d}{d t} \frac{1}{2} \int_{-\infty}^\infty u_t^2 + u_x^2 d x \\ = \frac{1}{2} \int_{-\infty}^\infty \frac{d}{d t} \left( u_t^2 + u_x^2 \right) d x \\ = \frac{1}{2} \int_{-\infty}^\infty 2 u_t u_{tt} + 2 u_x u_{xt} d x \\ = \int_{-\infty}^\infty u_t u_{tt} + u_x u_{xt} d x \\ = \int_{-\infty}^\infty u_t u_{tt} d x + \int_{-\infty}^\infty u_x u_{xt} d x \\ \stackrel{(1)}{=} \int_{-\infty}^\infty u_t u_{tt} d x + u_x u_t - \int_{-\infty}^\infty u_t u_{xx} d x \\ = \int_{-\infty}^\infty u_t u_{tt} - u_t u_{xx} d x + u_x u_t \\ = \int_{-\infty}^\infty u_t (u_{tt} - u_{xx}) d x + u_x u_t \\ = \int_{-\infty}^\infty u_t \cdot 0 d x + u_x u_t \\ = u_x u_t \\$$$$
Where I use partial integration in the step marked by 1, using $$u_x$$ as u and $$u_{tx}$$ as $$v'$$
• Of course, yes! Thanks. For some silly reason, I believed that due to the infinities, I wouldn't have to write the variation... Given in my original problem (but not in the question here) is compact support for $u_t$, which is surely sufficient. If you care to post the same thing again as an answer, I will accept it. May 10, 2019 at 17:48
After integrating by parts, the variation $$[u_xu_t]_{-∞}^{+∞}$$ of $$u_xu_t$$ over $$\bf R$$ should be written instead of $$u_xu_t$$ itself. Luckily, this variation is zero if $$u_x$$ vanishes at infinity, which is true in case of compact support.