A wedge of mass M and angle [alpha] slides freely on a horizontal plane. A particle of mass m moves freely on the wedge. Determine the motion of the particle as well as that of the wedge.
Here is as far as I've gotten:
We can write the position of the mass m as


where l is the length of the hypotenuse of the wedge that the mass is sliding on.
Thus, the kinetic energy of the mass m is equal to

The potential energy is equal to

Therefore, the Lagrangian can be written as

Thanks.