Conservation of energy
A spring S of force constant k=100N/m is fixed to the base of a 30 degree incline. A mass m=50g is held against the free end of the spring, so that the spring is compressed by 0.1 metre. If the mass is now released, calculate the distance travelled by the mass up the incline. don't ignore friction.
i tried using conservation of every theorem but i am not getting the solution. how should i start?

F- F of friction
Dalambers principle
Dx=0.1 meter - the spring is compressed by 0.1 metre
Kdx=F+ma+cos(60)∗mg
F=b∗sin(60)∗mg
Because sin(60)∗mg is normal force to our incline plane, b-coef of friction

So we have that
Kdx=b∗sin(60)∗mg+ma+cos(60)∗mg
The mass m will stop when kdx would be greater than b∗sin(60)∗mg+cos(60)∗mg
From here we can found x:
Cuz dx=x1−x0 x0 is length of spring at rest
K(x1−x0)=b∗sin(60)∗mg+cos(60)∗mg
Answer:
X1=(b∗sin(60)∗mg+cos(60)∗mg+k∗x0)/k