Are mechanical energy of an element of a rope and energy density constant in the case of mechanical waves? I'm confused about energy driven by a wave. Consider a sinousoidal wave moving in a rope. 
In my view each element $dm$ of the rope follows a simple harmonic motion in time. That means that the mechanical energy $dE=dK+dU$ of the single element $dm$ is constant. 
Nevertheless on Halliday-Resnik-Krane I found this explanation.

Despite the analogies with simple harmonic motion the mechanical
  energy of the element $dm$ is not constant. [...] That's not
  surprising since the element $dm$ is not an isolated system and its
  motion is the result of the action of the rest of the rope on it.

I really do not understand how this can be possible. A similar doubt is for the energy density per unit length.
To sum up I found two cotrasting description of the energy and the energy density in a mechanical wave on a rope.

$1.$ (This is the one I'm ok with) The mechanical energy of the single element $dm$ of the rope is constant and equal to $$dE=\frac{1}{2} dm v_{max}^2$$
From here the linear energy density, defined as
$$u=\frac{dE}{dx}=\frac{1}{2} \mu \omega^2 A^2$$
is constant.

$2.$ (Hallyday-Resnik-Krane) The mechanical energy of the single element of the rope is 
$$dE=\frac{1}{2} dm (\frac{\partial \xi}{\partial t})^2+\frac{1}{2} T(\frac{\partial \xi}{\partial x})^2 dx $$ 
($T$ is the tension of the rope)
The mechanical energy of the element of mass $dm$ is not constant since    the element is not isolated from the rest of the rope.
From here the linear energy density is not constant either and its expression is $u=\frac{dE}{dx}$


Which of these two is the correct one and why?
In the description $2.$ I'm ok with the expression of the mechanical energy but I do not agree with the fact that $dE$ and $u$ are not constant.
Is the mechanical energy of $dm$ really not constant? If so, what can be an explanation for that?
Is this somehow related to the fact that the energy of a wave is not concentrated in a single point but somehow spread in all the rope continuously?
Any suggestion on this topic is really appreciated.
 A: The second derivation is correct, as explained by Diracology.
However, the first derivation is 'sort of' correct, in the sense that the location of potential energy can be ambiguous. For example, consider the three following systems.


*

*A mass on a stretched spring.

*A mass sitting on a table.

*A charged mass next to another charge.


These three systems have elastic potential energy, gravitational potential energy, and electrical potential energy. But in an intro physics class, you'll get three different answers if you ask "where" the energy is. In the first case, it's the spring; in the second, it's "the system of Earth and mass"; in the third, it's "in the electric field between them". 
In all three of these cases, as long as we're not doing GR, it makes no difference where we say the potential energy is stored, because it can only be extracted one way: by moving the mass. You could say the potential energy is stored behind Jupiter if you want.
This is why you'll see various conventions for 'where' the energy is stored in a rope. However, in this case, there is an unambiguous correct answer, because a rope has many degrees of freedom, unlike a mass. You can extract the potential energy in the rope by taking any individual section of it and un-stretching it, implying that the potential energy $dU$ of a small piece of rope $dx$ is well-defined. 
Worse, for non-sinusoidal waves, the first definition gives the incorrect answer. Imagine a wave $y(x)$ that has $y = 1$ for $0 < x < L$ and $y = 0$ elsewhere. By the correct definition, there's only potential energy at $x = 0$ and $x = L$. By the incorrect definition, the total potential energy is proportional to $L$, which is wrong.
An even worse example: if I just hold the rope at $y = 1$ forever, the incorrect definition says the amount of potential energy is infinite! The correct answer is zero.
A: There are already good answers here, but I'm afraid that to the best of my knowledge, Diracology's (and indeed Halliday-Resnik-Krane's) expression of the potential energy is not correct. I would like to point to this paper by Lior M. Burko which focusses on the subtleties of the derivation of the kinetic and potential energy of the string as a whole and small mass elements of it. From the Abstract:

We consider the energy density and energy transfer in small amplitude, one-dimensional waves on a string, and find that the common expressions used in textbooks for the introductory physics with calculus course give wrong results for some cases, including standing waves. We discuss the origin of the problem, and how it can be corrected in a way appropriate for the introductory calculus based physics course.

To extract the result from this work, instead of 
$$dE=dK+dU=\frac 12\mu \left(\frac{\partial \xi}{\partial t}\right)^2dx+\frac{T}{2}\left(\frac{\partial \xi}{\partial x}\right)^2dx$$
it should read
$$dE=dK+dU=\frac 12\mu \left(\frac{\partial \xi}{\partial t}\right)^2dx+\frac{T}{2} \xi \left(\frac{\partial^2 \xi}{\partial x^2}\right)dx$$
According to the paper the two expressions give the same result for the global energy content of the string, but the energy densities are not the same. In Section IV it is demonstrated how this fixes some of the issues with an element not having constant energy in particular for standing waves.
A: The energy of an element of a traveling wave is not constant. Halliday-Resnick-Krane is right. For a string of density $\mu$ and tension $T$ the kinetic energy of an element $dx$ is
$$dK=\frac 12\mu dx\left(\frac{\partial \xi}{\partial t}\right)^2.$$
For the potential energy we have
$$dU=Tdl,$$
where $dl$ is the stretched amount of the string. A small section $dh$ of the string is the hypotenuse of a right angle triangle with basis $dx$ and height $\frac{\partial \xi}{\partial x}dx$. Hence the amount stretched is
$$dl=\sqrt{dx^2+\left(\frac{\partial \xi}{\partial x}\right)^2dx^2}-dx=\frac{dx}{2}\left(\frac{\partial \xi}{\partial x}\right)^2.$$
In the last equation we neglect higher order terms in $\left(\frac{\partial \xi}{\partial x}\right)$ since we assume small displacements. Then
$$dU=\frac{Tdx}{2}\left(\frac{\partial \xi}{\partial x}\right)^2.$$
Therefore
$$dE=dK+dU=\frac 12\mu \left(\frac{\partial \xi}{\partial t}\right)^2dx+\frac{T}{2}\left(\frac{\partial \xi}{\partial x}\right)^2dx.$$
For a progressive harmonic wave $\xi(x,t)=A\cos(kx-\omega t)$ we get
$$dE=\frac 12\mu\omega^2 A^2\sin^2(kx-\omega t)dx+\frac{1}{2}Tk^2A^2\sin^2(kx-\omega t)dx.$$
Using $v^2=T/\mu$ and $\omega=vk$ we get
$$dE=\mu\omega^2A^2\sin^2(kx-\omega t)dx,$$
which is not constant.
Remember that energy is being transmitted by the wave along the rope. The source of energy being the harmonic oscillator that generates the wave at one end of the string. So it is not a problem that the energy at each point is not constant. Another important point: The reason the result is quite different to what we expect when we think about simple harmonic motion (which gives constant energy for the particle) is that the element of the rope is not only moving transversely. A wave in a rope always have a longitudinal component. This was implicit when we computed the potential energy and assumed the stretched amount was the $dl=dh-dx$. Notice that when the element $dx$ has displacement $A$, it is at rest having vanishing kinetic energy. Moreover this element is not stretched, $\frac{\partial \xi}{\partial x}=0$, giving vanishing elastic potential energy. This does agree with the equation obtained for $dE$.
