Solution (source code)

= Solution

Choose the positive direction along the incoming car's <velocity>. Treat each car as a translating body, take $m_1,m_2>0$, and neglect external impulse, rotation and <energy> losses during the short <elastic collision>. If $v_1,v_2$ are the final signed <velocities>, <conservation of momentum> and <conservation of energy> give
$$
m_1U_1=m_1v_1+m_2v_2,\qquad
m_1U_1^2=m_1v_1^2+m_2v_2^2.
$$
Factoring the second relation and using the first gives $U_1+v_1=v_2$ on the collision branch. The other algebraic branch, $v_1=U_1,v_2=0$, describes no impulse and cannot describe separating bodies after contact. Solving the collision branch yields
$$
\boxed{v_1=\frac{R-1}{R+1}U_1,\qquad v_2=\frac{2R}{R+1}U_1,\qquad R=\frac{m_1}{m_2}.}
$$
For $0<R<1$ the first car rebounds and the second moves forwards. At $R=1$ the first stops and the second takes its original <velocity>. For $R>1$ both move forwards, with $v_2-v_1=U_1>0$, so they separate. In the limits $R\to0$ and $R\to\infty$, the first car's <velocity> approaches $-U_1$ and $U_1$, respectively.

For the deformable car, take $y=0$ at first contact. The resisting <force> does negative <work>. The <work-energy theorem> therefore gives
$$
\frac12Mv(y)^2=\frac12MV^2-\int_0^y\frac{ds}{\sqrt{L-s}}
=\frac12MV^2-2\bigl(\sqrt L-\sqrt{L-y}\bigr).
$$
At the first stop $v=0$, whence $\sqrt{L-y}=\sqrt L-MV^2/4$. The <speed> bound ensures that this right-hand side is positive, so squaring introduces no extraneous solution. The stopping compression is
$$
\boxed{y=L-\left(\sqrt L-\frac{MV^2}{4}\right)^2
=\frac{MV^2\sqrt L}{2}-\frac{M^2V^4}{16}.}
$$
For $0<V<2L^{1/4}/M^{1/2}$ this lies strictly between $0$ and $L$, as required before complete crushing. The coefficient in the stipulated <force> law is taken in its stated normalization.