Another
Homework Statement:
Find
1. the Lagrangian density of massive spring system
2. the energy density of this system
Relevant Equations:
divide massive spring to \rho = \frac{m}{L} = \frac{dm}{dy}
velocity of each small spring ## dm ## in ## v_i = \frac{V}{L} y_i##
this figure form ( https://en.wikipedia.org/wiki/Effective_mass_(spring–mass_system) )

massive spring ; m
K.E. of total spring equal to ## K.E. = \frac{1}{2} \sum dm_i v_i^2 = \frac{1}{2} \sum \rho dy (Vy/L)^2##

V is the speed at the end of the spring and V are same speed of mass M at the end of spring, SO
## K.E. = \frac{1}{2} \rho \frac{V^2}{L^2} \int_{0}^{L} y^2 dy = \frac{1}{2} \frac{m}{3} V^2 ##
Potential of the spring when divided by ## dm ##
## P.E. = \sum dm_i g y_i ## at equilibrium ## dm g = k dy_i ##
## P.E. = \sum dm_i g y_i = \sum k y_i dy_i = \int_{0}^{L} k y dy##

P.E. of mass M at the end of spring is ## P.E. = -MgL ## I think at any y ## P.E. ## may be written ##P.E. = -Mg dy##
K.E. of mass M ## K.E. = \frac{1}{2} M V^2 ##

The lagrangian of this system is L = K.E. - P.E.
and The lagrangian density is L therefore ## L = \int L dy##

from above I can write K.E. and P.E. of massive and P.E. o mass M at the end of massive spring in term dy but i can't write K.E. of mass M in term dy How can i solve this problem?