Model to understand tension varying in an hanging rope with mass From page-90 of Kleppner and Kolenkow,

An idealized model of a string is a single long chain of molecules
bound together by intermolecular forces. Suppose that force F is applied
to molecule 1 at the end of the string. The force diagram for molecules 1,2,3 are shown in sketch, $F=F'=F''=F'''$


They explain this equivalence through the idea that when the molecules are pulled, they are displaced from equilibrium under action of van der waals forces and hence the force try to push to contract the system.
I'm trying to extend this model of thinking about tension to ropes which have tension gradient, as in when we move across the length of rope, the tension on it changes. For example consider the dangling rope which the book discusses in subsequent example:

Here,
$$ T(x) = Mg \frac{x}{L}$$
So, how would use the previous model to understand this?
 A: You replace your rope by a chain of $N$ rope segments (what your source calls the molecules, however that could be misleading, so stick with rope segments) with mass $m$. Each of them has the weight $F = mg$. Let's label them such that the lowest one (in a coordinate system where the vector $\textbf{g}$ points downwards) has index $1$, the second lowest index $2$ etc. In the example of the rope being fixed on a tree branch, there is no motion in the rope, so the forces on all rope segments must balance each other out.
Therefore, the lowest rope fragment experiences the downward force $F_1 = mg$ and the upward force $F_{21} = -F_1 = - mg$ (the force on segment one due to segment two). They must be the same, otherwise segment one would experience accelerating motion, which is not part of this model. Now, the second rope segment experiences $F_2 = mg + F_{12} = mg - F_{21} = 2mg$. This again must be balanced in $F_{32} = - 2mg$. Continuing this process, we find that the $k$th segment experiences a downward force $F_{k} = kmg$, which is balanced by the upward force.
This force is the tension, so we have the first result $T_k = kmg$. Now, we need to use some limiting arguments to get to a continuous description of the rope. For that, we want to send the total number $N$ of segments to infinity while keeping the total mass $M = Nm$ constant. That means we need to view $m$ as a form  of density $m = M/N$. All segments should be equally spaced, so we can express $N$ by the lenght $L$ and the spacing $\Delta x$ via $N = L/\Delta x$. So the case $N \to \infty$ is tantamount to $\Delta x \to 0$.
We introduce a new variable $x = k \Delta x$ that describes at what length the index $k$ lands on the rope. Let's piece all of this together,
$$T_k = kmg = k \frac{M}{N}g = k \frac{M \Delta x}{L}g = \frac{k\Delta x}{L} Mg,$$
so in the limit $\Delta x \to 0$ with a fixed $x = k\Delta x$, we have
$$T(x) = \frac{x}{L} Mg.$$
Addendum
This model does not account for the dynamics of your system. The model is purely a description how a force exerted on a rope distributes over the rope in the form of a local tension (a little more precisely, we are actually dealing with a uniform force density here). I think the main confusion is because of the sort of faulty picture that identifies spring segments with molecules. This is a good description if one wanted to describe proteins, which can basically be modeled by long one-dimensional chains of molecules. A rope is usually a three-dimensional chain of molecules and it becomes kind of tricky to truly reduce this description to a molecular structure. Of course, it's not wrong to think about it this way, but then you start wondering about the motion of these molecules and all that, which isn't accounted for in this model.
The statement here is simply: You divide a rope in multiple identical segments, each of which must exert a force on its neighbor and be subject to an external force and its two neighbors' forces. You do not know how these forces relate to the stretching of the rope. All you do know is the weight $F$ on each segment, and that the rope is attached to some object (tree branch) that balances the forces and gives the rope a resulting length $L$. That (and nothing but that) is given in your model problem. You then continue, based on the model, to calculate how the force distributes over the length of the rope, giving you $T(x)$.
And that's that. The rope could be made of rubber or steel or hair. That doesn't matter in your model, as long as its final length is $L$ and its total mass is $M$, any material yields the same result. Discussion of elasticity requires a more sophisticated model, for example a chain of harmonic oscillators. Such systems can be considered when talking about linear elasticity.
A: Start from the point at the bottom. Let it be of $dx$ length then it experiences gravitational force due to its mass $Mdx/l$.
Tension $T$ on this element balances this force, apply third law to find that the element of top of it experiences an extra force $Mg dx/l$ In downward direction hence Tension on second element $T'$ = $T+Mgdx/l$.
You can treat it like an arithmetic progression and find the $nth$ term.
A: At each point $x$ on the rope there is a $F_g = \frac{M}{L}gx$ since the total mass of all the 'molecules' pulling down at $x$ is $\frac{M}{L}x$. So then at each point along the rope the the 'intermolecular' force exerted upwards at each point in the rope to keep itself stationary is $\frac{M}{L}gx := T(x)$.
At each point along the rope $T(x)$ is collective 'inter molecular' Force which is required to keep the object together basically. and we found that $ T(x) = Mg\frac{x}{L}$.
A: Model the rope as a linear array of similar atoms, each atom is separated at some constant distance $d$ and had a finite mass $m$.
Start from the atom at the lowermost point, it experiences gravitational force $mg$ but is at equilibrium therefore the upper molecule applies force $mg$ due to Vanderwaal forces.
Now this upper atom (second atom from the bottom) experiences force $2mg$ downwards therefore force applied by the third atom is  $2mg$.
Continuing this upwards the $nth$ atom applies a force $(n-1)mg$ and experiences $nmg$ force.
A point at $x$ distance from the bottom corresponds to $n=x/d$ therefore T= $xmg/d$.
As mass of rope $M=mN$ wher $N$ is the number of atoms which is $L/d$.
$M=mL/d$, substitute for T and you get the desired variation.
