When calculating the elastic potential energy of a string segment inside a transversal string-wave, it is usually reasoned that the string tension $T$ causes the string segment to stretch as it oscillates, and therefore produces work equal to: $$\Delta U~=~T(d\ell-dx).$$ My question is, how come the entirety of the tension $T$ is contributing work here? We seem to be implying that the tension is always parallel to the string segment, but how is that possible if the tension also generates transversal movement in the string?
Indeed, don't we assume that the string is curved to derive the wave equation in the first place? Shouldn't we take some geometric factor into account when calculating the work done to stretch the segment?