> A rope with length $L$ and mass density per unit length $ρ$ is suspended vertically from one end. Find the tension as a function of height along the rope

I just don’t understand the way the functions have been used in the solution of the question (this from Morin’s classical mechanics book)