Solution (source code)

= Solution

For an equilibrium string segment of length $dx$, the mass is $\rho\,dx$. Under the small-slope approximation, the transverse <tension> component at an endpoint is $T y_x$. The difference between its two endpoint contributions is $T[y_x(x+dx,t)-y_x(x,t)]\simeq T y_{xx}dx$.

<Newton's second law> in the transverse direction gives $\rho y_{tt}dx=T y_{xx}dx$. Cancelling the segment length produces
$$
\boxed{y_{tt}-c^2y_{xx}=0,\qquad c=\sqrt{T/\rho}}.
$$
This <wave equation> assumes a uniform string, small slopes, negligible gravity and negligible bending stiffness. Longitudinal changes in <tension> and the difference between actual and equilibrium segment length contribute only beyond the linear approximation used here.