(a) At maximum compression the trolleys are neither approaching nor separating, so they share one velocity V. Momentum is conserved (no external horizontal force):
(5)(8)=(5+3)V⇒V=5 m s−1
Kinetic energy: initially 21(5)(8)2=160 J; at maximum compression 21(8)(5)2=100 J. The missing 60 J is stored in the spring:
21(3000)x2=60⇒x2=0.04⇒x=0.20 m
Common velocity 5 m s−1; maximum compression 0.20 m.
(b) The spring returns all its energy, so the interaction as a whole is an elastic collision with the 3 kg trolley initially at rest:
v1=m1+m2m1−m2u=82(8)=2 m s−1,v2=m1+m22m1u=810(8)=10 m s−1
After separating, the 5 kg trolley moves at 2 m s−1 and the 3 kg trolley at 10 m s−1, both forward. Check: momentum 10+30=40 kg m s−1 and kinetic energy 10+150=160 J, both as before.