Energy method for damped wave equation vs heat eq. The textbook I using is Strauss's partial differential equations.
I don't understand how to find the energy formula for different pdes. It seems that the textbook does not give a general method to find the energy. For example, in the textbook it shows for string $\rho u_{tt}=Tu_{xx}$ the energy is $E=\frac12 \int^{\infty}_{-\infty}(\rho u^2_t+Tu^2_x)dx$ as below.(first picture).
But in exercise it asks for the damped string equation $u_{tt}-c^2u_{xx}+ru_t=0$, show that the energy decreases. I don't understand why the pde changes, the energy still is $E=\frac12 \int^{\infty}_{-\infty}(\rho u^2_t+Tu^2_x)dx$?
And the in the book it derives energy for diffusion equation in a totally different. (second picture)
It seems that one can define energy whatever they like, but that cannot be true. So I am really confused about what the "energy" means in energy method, and how to find the formula for the energy in different pdes.
first picture

second picture




 A: For the proposed wave equations, an energy can be derived by multiplication of each term through $u_t$ and integration over $x$ in $\Bbb R$. In fact, integration rules give on the one hand
$$
\int u_t u_{tt} \,d x = \frac{d}{dt} \int \tfrac12 u_{t}^2 \,dx  ,
$$
and on the other hand
$$
\int u_t u_{xx} \,d x = -\frac{d}{dt} \int \tfrac12 u_{x}^2 \,d x  .
$$
Applying this process to the damping term $u_t$ yields a signed quantity:
$$
\int u_t^2 \,d x \geq 0 .
$$
So if we consider the damped wave equation $u_{tt} - c^2 u_{xx} = -r u_t$ with $r\geq 0$, we find
$$
 \frac{d}{dt} \int \tfrac12 [u_t^2 + c^2 u_x^2] \, d x = -r \int u_t^2 \,d x \leq 0 .
$$
The left-hand side represents the time derivative of an energy, while the negative quantity in the right-hand side represents dissipation. The damping term with coefficient $r$ influences dissipation, but it does not modify the expression of energy. Note that energy is a non-negative decaying function of time for all $r\geq 0$.
Essentially, the derivation of the energy for the wave equation is very similar to the case of the heat equation, but there is no rule in general. In analytical mechanics, we call Hamiltonian PDEs the partial differential equations that can be derived from an "energy" (more precisely, from a Hamiltonian density). The derivation of dissipation inequalities from physical ground principles is the subject of thermodynamics.
