If the spring were deformed uniformly, the tension would be $$T=Ku_L$$where ##u_L## is the displacement at x = L, assuming that x = 0 is fixed. This equation can also be written as $$T=KL\frac{u_L}{L}$$where the local uniform strain in the spring is given by $$\epsilon(x)=\frac{u_L}{L}=\frac{\partial u}{\partial x}$$Therefore, in any arbitration non-uniform axial deformation of the spring, the local tension is given by:
$$T(x)=KL\frac{\partial u}{\partial x}$$
For the problem at hand, if we perform a force balance on the portion of the spring between x and ##x+\Delta x##, we obtain:$$T(x+\Delta x)-T(x)=\frac{m}{L}\Delta x\frac{\partial^2u}{\partial t^2}$$Combining the previous two equations, dividing by ##\Delta x##, and taking the limit as ##\Delta x## approaches zero yields:
$$\frac{\partial^2u}{\partial t^2}=\frac{KL^2}{m}\frac{\partial^2u}{\partial x^2}=c^2\frac{\partial^2u}{\partial x^2}$$where c is the wave speed: $$c=L\sqrt{\frac{K}{m}}$$The boundary condition at x = L is zero tension: ##\frac{\partial u}{\partial x}=0## @ x = L.
The solution to this problem is going to be of the form $$u(x,t)=A(x)\cos{\omega t}+B(x)\sin{\omega t}$$subject to the initial conditions ##A(0)=\epsilon##, B(0)=0.