A 5 g bullet is fired into a 2 kg wooden block attached to a spring with a force constant of 20 N/m. It lodges in the block, and the block and bullet compress the spring until they come to a rest. If the bullet was moving at 1000 m/s just before the collision, how far is the spring compressed when the bullet and block stop?

m1•v =(m1+m2)u,

u=m1•v/(m1+m2).

(m1+m2)u²/2=kx²/2,
x=u•sqrt[(m1+m2)/k}=
= m1•v•sqrt[(m1+m2)/k}/(m1+m2)=
=m1•v/sqrt[k•(m1+m2)]=
=0.005•1000/sqrt[20(2+0.005)]=3.53 m.

To calculate the distance the spring is compressed when the bullet and block stop, we can use the principle of conservation of momentum and the principle of conservation of mechanical energy.

1. Conservation of momentum:
- Before the collision, the bullet is moving at a velocity of 1000 m/s. Since the bullet lodges in the block, the combined mass of the bullet and block after the collision is the sum of their masses, which is 5 g (0.005 kg) + 2 kg = 2.005 kg.
- Let's call the final velocity of the bullet and block after the collision v_f.
- By applying the principle of conservation of momentum, the momentum before the collision is equal to the momentum after the collision:
Momentum before = Momentum after
(mass of bullet) * (velocity of bullet before) = (mass of bullet + mass of block) * (velocity of bullet and block after)
(0.005 kg) * (1000 m/s) = (2.005 kg) * (v_f)

2. Conservation of mechanical energy:
- The bullet and block stop when all of their kinetic energy is converted into potential energy stored in the spring, as the spring is compressed.
- The kinetic energy before the collision is equal to the sum of the kinetic energy of the bullet and block:
Kinetic energy before = (1/2) * (mass of bullet) * (velocity of bullet before)^2
+ (1/2) * (mass of block) * (velocity of block before)^2
Kinetic energy before = (1/2) * (0.005 kg) * (1000 m/s)^2

- The potential energy stored in the spring when it is compressed is given by Hooke's law:
Potential energy = (1/2) * (force constant of spring) * (compression distance)^2
Potential energy = (1/2) * (20 N/m) * (compression distance)^2

- By applying the principle of conservation of mechanical energy, the kinetic energy before the collision is equal to the potential energy after the collision:
Kinetic energy before = Potential energy after
(1/2) * (0.005 kg) * (1000 m/s)^2 = (1/2) * (20 N/m) * (compression distance)^2

To find the compression distance, we can equate the momentum equation and the mechanical energy equation and solve for the compression distance.