The correct equation that shows the conservation of mechanical energy for this system, where a marble is attached to a compressed spring, is:
\[ \frac{1}{2}mv^2 = \frac{1}{2}kx^2 \]
This equation states that the kinetic energy (\(\frac{1}{2}mv^2\)) of the marble when the spring is released is equal to the potential energy stored in the spring (\(\frac{1}{2}kx^2\)) when it was compressed. Hence, the correct response is:
\[ \frac{1}{2}mv^2 = \frac{1}{2}kx^2 \]