Consider small displacements, $y(x,t)$, of an element of a string (circled in red and shown below) from equilibrium.
The force balance in the vertical direction yields: $$+\uparrow \Sigma F: -T\sin(\theta_1)+T\sin(\theta_2)=(mdx)\frac{\partial^2 y}{\partial t ^2}$$ Where we (well.. my prof) have equated the tension on either side of the element because we are considering the case in which there is no horizontal acceleration and because we are making a small angle approximation
$$T_{left}\cos(\theta_1)=T_{right}\cos(\theta_2).$$
After linearizing and simplifying, we end up with the 1D wave equation: $$c^2 \frac{\partial^2 y}{\partial x ^2} = \frac{\partial^2 y}{\partial t ^2}$$ where $c^2 = \frac{T}{m}$.
For the Lagrangian approach, I am able to write down the kinetic energy of the element and of the entire string (I think):
For the string: $$T=\frac{1}{2}\int_{_0}^{^L} \rho \dot y(x)^2 dx.$$
Where $y$ is a function of $x$ because we can have a different velocity in the $y$ direction at every point $x$.
For an element of the string: $$T=\frac{1}{2}m(dx)\dot y^2.$$
I am stumped at the potential energy for both the element and the string as a whole and I can't seem to figure out how to recover this wave equation from first principles. The potential energy should be proportional to the displacement $y$ from equilibrium but from what I'm seeing online it doesn't look anything like the potential energy due to a spring. What I've seen here is that "for a taut string, the stored energy of system described by the height function $u(x)$ is assumed to be proportional to the change in length": $$\int_a^b (\sqrt{1+u'^2}-1)dx$$ Which is a complete mystery to me.
So my question is how do I recover the EOMs for a taught string using the Lagrangian? I am also interested in how this particular case can be recovered from a more general solution but I may not have the background to understand that.