# Constants of motion in Lagrangian

There's a specific problem I'm doing, but this is more of a general question. The setup is a cylinder of mass $m$ and radius $R$ rolling without slipping down a wedge inclined at angle $\alpha$ of mass $M$, where the wedge rests on a frictionless surface. I've made the Cartesian axis centred at the initial position of the centre of mass of the cylinder. Then, $x_{m}$ and $x_{M}$ are the horizontal distances of each mass (measured from the y-axis, so both quantities are positive), $y$ is the vertical position of the centre of mass of the cylinder and $\theta$ is the angle through which the cylinder has rolled. This makes it very easy to write down the Lagrangian:
$$\mathcal{L} = \mathcal{K} - \mathcal{U} = \frac{1}{2}M\dot{x}_{M}^{2} + \frac{1}{2}m(\dot{x}_{m}^{2} + \dot{y}^{2}) + \frac{1}{4}mR^{2}\dot{\theta}^2 + mgy$$
As of right now, the Lagrangian "doesn't know" about the fact that the cylinder's constrained to be stuck to the wedge. Basic trigonometry gives the relation $y = d \sin(\alpha)$, where $d$ is the distance travelled by the cylinder. But then, the cylinder rolls without slipping, so $d = R\theta$ and therefore $y = R \sin(\alpha) \theta$. But then we also have that $y = (x_{m} + x_{M})\tan(\alpha)$ by an identical argument.

Here's where my question comes in. Do I have to sub in both constraints when determining the constants of motion, and does it matter which variables I eliminate? As it stands, the Lagrangian doesn't depend on $\theta$, $x_{m}$ or $x_{M}$, which leads one to believe that all those associated momenta are conserved, but the issue is that $y$ technically does depend on on those variables. It seems weird that no momenta would be conserved.