To find the relation between velocities before and after the collision, use the concept of conservation of momentum by equating equations (i) and (ii), you get:
\(\begin{aligned}{c}\left( {7.87 \times {{10}^{ - 3}}\;{\rm{kg}}} \right)v &= \left( {4.155\;{\rm{kg}}} \right)v'\\v' &= 1.89 \times {10^{ - 3}}v\end{aligned}\)
The kinetic energy of the combined system can be calculated as:
\(\begin{aligned}{c}K &= \frac{1}{2}\left( {m + M} \right){{v'}^2}\\K &= \frac{1}{2}\left( {\left( {7.870\;{\rm{g}} \times \frac{{{{10}^{ - 3}}\;{\rm{kg}}}}{{1\;{\rm{g}}}}} \right) + \left( {4.148\;{\rm{kg}}} \right)} \right) \times {\left( {1.89 \times {{10}^{ - 3}}v} \right)^2}\\K &= 7.42 \times {10^{ - 6}}{v^2}\end{aligned}\) … (iii)
The spring energy due to compression can be calculated as:
\(\begin{aligned}{c}U &= \frac{1}{2}k{x^2}\\U &= \frac{1}{2} \times \left( {162.7\;{{\rm{N}} \mathord{\left/{\vphantom {{\rm{N}} {\rm{m}}}} \right.} {\rm{m}}}} \right) \times {\left( {9.460\;{\rm{cm}} \times \frac{{{{10}^{ - 2}}\;{\rm{m}}}}{{1\;{\rm{cm}}}}} \right)^2}\\U &= 0.72\;{\rm{J}}\end{aligned}\) … (iv)
Now, to find the speed v of the bullet, use the conservation of energy by equating equations (iii) and (iv), you get:
\(\begin{aligned}{c}7.42 \times {10^{ - 6}}{v^2} &= 0.72\;{\rm{J}}\\{v^2} &= 97.03 \times {10^3}\;{{{{\rm{m}}^2}} \mathord{\left/{\vphantom {{{{\rm{m}}^2}} {{{\rm{s}}^2}}}} \right.} {{{\rm{s}}^2}}}\\v = 311.49\;{{\rm{m}} \mathord{\left/{\vphantom {{\rm{m}} {\rm{s}}}} \right.} {\rm{s}}}\end{aligned}\)
Hence, the speed v of the bullet is \(311.49\;{{\rm{m}} \mathord{\left/{\vphantom {{\rm{m}} {\rm{s}}}} \right.} {\rm{s}}}\).