We have 2 kind of mechanical wave, which is transversal and longitudinal. In calculating the kinetic energy we just integrate dm v^2 of course. Also in calculating the potential energy of an element of a longitudinal wave we can do it by making it as a small spring with a constant k' and just count 1/2 k' x'^2. But how we count the potential energy of a transversal wave. I have tried to integrate T sine theta dy, but I think that's not how we do that. I do need helps from all of you. Thanks. Sorry about my English.