# Two blocks connected with spring and pulley

## Homework Statement

A block of mass m1= 20.0kg connected to a block of mass m2 =30.0 kg by a massless string that passes over a light, frictionless pulley. The 30.0-kg block is connected to a spring that has negligible mass and a force constant of k =250 N/m as shown in Figure P8.64. The spring is unstretched when the system is as shown and the incline is frictionless. The 20kg block is pulled a distance 20cm down the incline of angle theta = 40 degrees and released from rest find the speed of each block when the spring is again unstreched

Ei =Ef

## The Attempt at a Solution

Iam confused if we should have 0.5Kx2 as the energy in the system finally. This how I think the equation should be set up but Im not sure if my reasoning is right for the 1/2kx2 being there (the mass of the block will compress the string isnt.
Taking the intial point from when m2 is 20cm down and m1 is 20cm up :

M2gh + 1/2kx2 = 1/2(M1 + M2)vf2 + M1gh + 1/2kx2

Would this be correct. At the final position the spring will compress 0.784 since:
M2g = kx
X = (20)(9.8)/250
X = 0.784

So is my reasoning correct or am I having misconceptions