A body of mass m is held at a height H above a table. Below…
A body of mass $m$ is held at a height $H$ above a table. Below it, standing on the table, is an undeformed spring of natural length $l_0$ and stiffness $k$. The body is released and falls onto the spring. What is the largest compression of the spring? What is the largest extension if the body sticks to the spring and oscillates?
Explanation of Method
A body falling onto a spring.
Step 1: Energy balance at the lowest point
At the lowest point the body is momentarily at rest, at height $l_0 - x$. It has fallen $H - l_0 + x$: $mg\,(H - l_0 + x) = \tfrac12 kx^2$.
\[ x^2 - \frac{2mg}{k}\,x - \frac{2mg\,(H - l_0)}{k} = 0. \]
Step 2: Largest compression
Taking the positive root: $x_{\max} = \frac{mg}{k}\left(1 + \sqrt{1 + \frac{2k\,(H - l_0)}{mg}}\right)$.
Step 3: Largest extension (if the body stays on the spring)
The body then oscillates about the equilibrium compression $mg/k$ with amplitude $x_{\max} - mg/k$. The other end of the swing is
\[x_{\text{ext}} = \frac{mg}{k}\left(\sqrt{1 + \frac{2k\,(H - l_0)}{mg}} - 1\right)\]
Check
Released just at the spring's top ($H = l_0$): $x_{\max} = 2mg/k$, twice the static compression, and $x_{\text{ext}} = 0\ \checkmark$
Result
\[\boxed{\,x_{\max} = \frac{mg}{k}\left(1 + \sqrt{1 + \frac{2k\,(H - l_0)}{mg}}\right)\,}\]
\[\boxed{\,x_{\text{ext}} = \frac{mg}{k}\left(\sqrt{1 + \frac{2k\,(H - l_0)}{mg}} - 1\right)\,}\]
Remark
About the original solution. Its quadratic equation is right, but in the first result the sign under the root is wrong ($1 - \ldots$ instead of $1 + \ldots$), and it uses the symbol $h$ (and later $l_j$) instead of $l_0$. With the minus sign the compression would even become imaginary for large $H$. The second result, the extension on the rebound, is correct once $l_j$ is read as $l_0$. If the body is not attached, it simply bounces back up to height $H$.