# Why do we always say in spring setup with 2 blocks that when their velocities will be equal it will have maximum elongation/compression?

In this Case the velocites are opposite.Here's my undrestanding: There are spring setups in which a block having a velocity strikes a spring attached to another block and in that case we find maximum compression by saying that at the point when both the blocks have equal velocity the compression would be maximum as one block with the greatee velocity tends to increase the elongation and the other with less velocity tends to decrease it and the spring opposes the block having more velocity whereas it increase the velocity of the block that was at rest and has less velocity intially So naturally when the both have equal velocities its the maximum compression because after that the spring tend oppose the other block and the process repeats ..... BUT in this case when they have opposite velocities I say that both the blocks tend to elongate the spring and the speing tries to oppose the motion of both the blocks...so one block (the one with facing more retardation will stop first and the other one woukd still be trying to elomgate the spring)Thats my point of maximum elongation becausw after that the other block tends to compress the spring.But somehow this is wrong as with my calculation I got it around 26 cm when that point occurs and then according ti the method if equal velocity it gives 30 which is more than 26.So where Am I wrong?

Assume the displacements of the blocks to be $$\vec{x_1}$$ and $$\vec{x_2}$$. Elongation in the spring will be $$\vec{x}=\vec{x_1}-\vec{x_2}$$ Differentiating both the sides, $$\frac{d\vec{x}}{dt}=\frac{d\vec{x_1}}{dt}-\frac{d\vec{x_2}}{dt}$$ Therefore, $$\vec{v_1}=\vec{v_2}$$ since, $$\frac{d\vec{x}}{dt}=0$$