# Variable tension in rope connected to mass

Problem 3.9 from Kleppner and Kolenkow's text An Introduction to Mechanics involves a uniform rope of length $L$ and mass $m$ that is connected at one end (its "bottom" end) to a block of mass $M$ and is being pulled with a force $F$ at its other end (its "top" end). The problem asks to find the tension $T(x)$ in the rope a distance $x$ away from the end being pulled, while neglecting gravity. I am very unsure of the answer I came up with.

First, I assumed that the acceleration of the block and each segment of rope would be equal and that the force acting the block would be upwards with magnitude $T(L) = F$. Each small segment of rope (length $\Delta x$, mass $\Delta m = \frac{m}{L} \Delta x$), undergoes an upward force $T(x)$ and a downward force $T(x+\Delta x)$ such that

$$\frac{-F}{M} = \frac{T(x+\Delta x) - T(x)}{\Delta m}$$

Isolating the variables related to the variable tension and taking the limit $\Delta x \rightarrow 0$ yields

$$\frac{dT}{dx} = \frac{m}{ML}F$$

After integrating using the assumed boundary condition $T(L) = F$, I arrived at the answer

$$T(x) = (1 - \frac{m}{M})F + \frac{mF}{ML}x$$

Is there anything wrong with my thought process? I thought that the net force on any segment of rope would always be zero because of Newton's Third Law, yet my use of $T(x + \Delta x) - T(x)$ (which should be zero) provided an answer that seems reasonable. Does my answer contradict Newton's law, or is my understanding of it flawed?