Answer :
Let's understand the situation carefully. once we understand it, the answer is very simple.
The arrow with mass m, velocity v strikes the block of mass M which was at rest. The block and arrow now move together with velocity V. From conservation of momentum,
[tex]mv=(m+m)V \\ \\ V= \frac{mv}{M+m} [/tex]
Now the block and arrow will move away from the equilibrium position of spring and thus they will expand the spring. The kinetic energy of the block and arrow will decrease and the potential energy of the spring will increase. It will go on till all the KE is converted into PE of spring. After that the Spring will start to compress and the block and arrow will gain KE. At the mean position, their KE will be same as initial as there is no dissipation of energy(just after the arrow had stroke the block). Now the block will start compressing the spring and again the KE of the block and arrow would decrease gradually and the PE of spring will increase again. It will continue till the KE of block and arrow reaches 0. That is the point of maximum compression of spring and all the KE of the block and arrow is converted to PE of spring as there is no dissipation of energy.
So from conservation of energy,
KE of block and arrow after the strike = PE of spring at maximum compression point
[tex] \frac{1}{2}(M+m)V^2= \frac{1}{2}k x^{2} [/tex]
where x = the distance between equilibrium position and maximum compression point
[tex] \frac{1}{2}(M+m) ( \frac{mv}{M+m})^{2} = \frac{1}{2}k x^{2} \\ \\ x^{2} = \frac{ (mv)^{2} }{k(M+m)} \\ \\ x = \frac{ mv }{ \sqrt{k(M+m)}}[/tex]
So the maximum compression is[tex]\boxed{\frac{ mv }{ \sqrt{k(M+m)}}}[/tex]
The arrow with mass m, velocity v strikes the block of mass M which was at rest. The block and arrow now move together with velocity V. From conservation of momentum,
[tex]mv=(m+m)V \\ \\ V= \frac{mv}{M+m} [/tex]
Now the block and arrow will move away from the equilibrium position of spring and thus they will expand the spring. The kinetic energy of the block and arrow will decrease and the potential energy of the spring will increase. It will go on till all the KE is converted into PE of spring. After that the Spring will start to compress and the block and arrow will gain KE. At the mean position, their KE will be same as initial as there is no dissipation of energy(just after the arrow had stroke the block). Now the block will start compressing the spring and again the KE of the block and arrow would decrease gradually and the PE of spring will increase again. It will continue till the KE of block and arrow reaches 0. That is the point of maximum compression of spring and all the KE of the block and arrow is converted to PE of spring as there is no dissipation of energy.
So from conservation of energy,
KE of block and arrow after the strike = PE of spring at maximum compression point
[tex] \frac{1}{2}(M+m)V^2= \frac{1}{2}k x^{2} [/tex]
where x = the distance between equilibrium position and maximum compression point
[tex] \frac{1}{2}(M+m) ( \frac{mv}{M+m})^{2} = \frac{1}{2}k x^{2} \\ \\ x^{2} = \frac{ (mv)^{2} }{k(M+m)} \\ \\ x = \frac{ mv }{ \sqrt{k(M+m)}}[/tex]
So the maximum compression is[tex]\boxed{\frac{ mv }{ \sqrt{k(M+m)}}}[/tex]