Answer
The maximum compression distance of the spring is $~~25~cm$
Work Step by Step
We can use conservation of momentum to find the speed $v$ of the two blocks after the collision when the spring is at maximum compression:
$p_f = p_i$
$(2.0~kg+5.0~kg)~v = (2.0~kg)(10~m/s)+(5.0~kg)(3.0~m/s)$
$v = \frac{(2.0~kg)(10~m/s)+(5.0~kg)(3.0~m/s)}{7.0~kg}$
$v = 5.0~m/s$
We can find the total kinetic energy before the collision:
$K_i = \frac{1}{2}(2.0~kg)(10~m/s)^2+\frac{1}{2}(5.0~kg)(3.0~m/s)^2$
$K_i = 100~J+22.5~J$
$K_i = 122.5~J$
We can find the total kinetic energy of the system after the collision:
$K_f = \frac{1}{2}(7.0~kg)(5.0~m/s)^2$
$K_f = 87.5~J$
We can find the change in the kinetic energy of the system:
$\Delta K = K_f - K_i = 87.5~J - 122.5~J = -35~J$
The total kinetic energy of the system decreases by $~~35~J$
This "missing" energy is stored in the spring.
We can find the maximum compression distance of the spring:
$\frac{1}{2}kx^2 = 35~J$
$x^2 = \frac{(2)(35~J)}{k}$
$x = \sqrt{\frac{(2)(35~J)}{k}}$
$x = \sqrt{\frac{(2)(35~J)}{1120~N/m}}$
$x = 0.25~m$
$x = 25~cm$
The maximum compression distance of the spring is $~~25~cm$.