Rope lying on table and hanging through hole In Kleppner's Mechanics, there is a problem given as

A rope of mass $M$ and length $l$ lies on a frictionless table, with
a short portion, $l_0$, hanging through a hole. Initially the rope is at rest.
Find the general equation for the length of rope hanging through hole.

In the solution, the problem is solved by using momentum equation given as-
Suppose at time $t$, $x$ length of ripe is hanging
Initial momentum at time t, $P_t$= $Mv$
Momentum at time $t+dt$, $P(t+dt) = M(v+dv)$
Rate of change of momentum = $Mdv/dt$
dp/dt = Force on rope
$Mdv/dt = Mxg/l$
Then we can solve for the expression for $x$.
The question is that while rope is hanging from table then hanging part moves with velocity $v$ in downward direction and the part which rest on table moves with velocity $v$ in horizontal direction and the force of weight of hanging part acts in downward direction.
Then how we write the momentum of rope as $Mv$ and $M(v+dv)$, shouldn't velocity involve separate x and y component in velocity?
Like how we write the initial and final momentum of rope in vector notation?
How we write the momentum of whole rope using a single velocity in one y-component(not including x component) and equate the change of momentum to downward force of weight?
Please explain.
 A: I'll demonstrate how considering horizontal and vertical components of momentum gives the same result.
Let the mass of the horizontal part be $m_1$, mass of the hanging part be $m_2$, tension in the string be T, and the linear mass density be $\lambda$
$F_x = m_1 \frac {dv}{dt} + v \frac {dm_1}{dt} = T$
$\therefore m_1a-v^2\lambda=T$    $\therefore v^2\lambda=m_1 a-T$
$F_y = m_2 \frac {dv}{dt} + v \frac {dm_2}{dt} = m_2g-T$
$\therefore m_2a+v^2\lambda=m_2g-T$
$\therefore m_2a+m_1a-T=m_2g-T$
$\therefore Ma=m_2g$
You can further use $ m_2x=Ml$ to get the same result as the one in your book. However, the method used in the book is much shorter and easier.
A: Falling chains and ropes  are  notoriously difficult problems with a long and disputed literature going back to Tait and Cayley in the 19th centure. I recommend starting with the article listed below. If you get a different answer from your textbook, you may be write and the book wrong.
Article:
A uniform explanation of all falling chain phenomena
Mark Denny
American Journal of Physics 88, 94 (2020); https://doi.org/10.1119/10.0000304
It might be behind a paywall I'm afraid.
