Step 1: Understanding the Question:
This problem involves a two-stage physical process: first, a completely inelastic collision between a bullet and a stationary block, followed by the compression of a spring attached to the combined mass.
Step 2: Key Formulas and Approach:
1. Conservation of Linear Momentum during the collision (since the impact is instantaneous and external spring force is negligible during this very short time interval):
\[ p_{\text{initial}} = p_{\text{final}} \implies m v = (M + m) V \]
2. Conservation of Mechanical Energy during the subsequent spring compression:
\[ \frac{1}{2} (M + m) V^2 = \frac{1}{2} k x_{\max}^2 \]
Step 3: Detailed Explanation:
Let us first find the velocity $V$ of the combined mass $(M + m)$ immediately after the completely inelastic collision. Using conservation of linear momentum:
\[ m v = (M + m) V \implies V = \frac{m v}{M + m} \]
Once the bullet is embedded in the block, the combined system acts as a single mass $(M + m)$ with initial kinetic energy:
\[ K = \frac{1}{2} (M + m) V^2 \]
As the combined mass moves to the left, it compresses the spring of spring constant $k$. Since the surface is frictionless, mechanical energy is conserved during the compression process.
The kinetic energy of the combined mass is entirely converted into elastic potential energy of the spring at the point of maximum compression $x_{\max}$:
\[ \frac{1}{2} (M + m) V^2 = \frac{1}{2} k x_{\max}^2 \]
Substitute the expression for $V$ into the energy conservation equation:
\[ (M + m) \left( \frac{m v}{M + m} \right)^2 = k x_{\max}^2 \]
\[ \frac{m^2 v^2}{M + m} = k x_{\max}^2 \]
Solve for $x_{\max}$:
\[ x_{\max}^2 = \frac{m^2 v^2}{k(M + m)} \implies x_{\max} = \sqrt{\frac{m^2 v^2}{k(M + m)}} \]
Step 4: Final Answer:
The maximum compression in the spring is $\sqrt{\frac{m^2v^2}{k(M + m)}}$, which corresponds to Option (A).