Physics
posted by Trevor .
A block of mass m is placed in a smoothbored spring gun at the bottom of the incline so that it compresses the spring by an amount x_c. The spring has spring constant k. The incline makes an angle theta with the horizontal and the coefficient of kinetic friction between the block and the incline is mu. The block is released, exits the muzzle of the gun, and slides up an incline a total distance L.
Find L, the distance traveled along the incline by the block after it exits the gun. Ignore friction when the block is inside the gun. Also, assume that the uncompressed spring is just at the top of the gun (i.e., the block moves a distance x_c while inside of the gun). Use g for the magnitude of acceleration due to gravity.

The block moves up the ramp until the initial kinetic energy equals the potential energy increase PLUS the work done against friction.
The initial kinetic energy equals the potential energy of the compressed spring, so
(1/2)k*x_c^2 = M g L sin theta + M g (cos theta)*mu*L
Solve for L 
L=[k(x_c)^2  2mg(x_c)sin(theta)]/[2mg[(mu)cos(theta) + sin(theta)]]