# Small mass on a dome (problems with derivatives)

I was trying to solve the classical problem of finding when a mass sliding on a frictionless dome loses contact with said dome.

I got the lagrangian $$L=\frac{1}{2}M\left(r\,\dot{\theta}\right)^2-Mgr\cos\theta$$ and I got the 2 lagrangian equations (with the lagrangian multipliers):

$$Mr\dot{\theta}^2-Mg\cos\theta+\lambda=0$$

&

$$Mr^2\ddot{\theta}-Mgr\sin\theta=0$$

I've now managed to solve the problem, but on my first attempt I thought it was a good idea to isolate $$\dot{\theta}$$ on the first equation to write $$\dot{\theta}=\sqrt{\frac{g}{r}\cos\theta-\frac{\lambda}{Mr}}$$. Then, I calculated the derivative:

$$\ddot{\theta}=\frac{-\frac{g}{r}\sin\theta\,\dot{\theta}}{2\sqrt{\frac{g}{r}\cos\theta-\frac{\lambda}{Mr}}}=\frac{-\frac{g}{r}\sin\theta\,\dot{\theta}}{2\dot{\theta}}=-\frac{g}{2r}\sin\theta$$

The problem is that, from the second equation, I get:

$$\ddot{\theta}=\frac{g}{r}\sin\theta$$

How can this be?

The problem is in your first step, you forgot the implicit time dependence of $$\lambda$$. To get the correct result, you'll need the chain rule since you know $$\lambda$$ as a function of $$\theta$$. You'd get: $$\ddot \theta = -\frac{\frac{g}{r}\sin\theta\dot \theta+\frac{1}{Mr}\dot\lambda}{2\sqrt{\frac{g}{r}\cos\theta-\frac{1}{Mr}\lambda} }\\ =-\frac{\frac{g}{r}\sin\theta+\frac{1}{Mr}\lambda'}{2\sqrt{\frac{g}{r}\cos\theta-\frac{1}{Mr}\lambda}} \dot \theta\\ = -\frac{1}{2}\left(\frac{g}{r}\sin\theta+\frac{1}{Mr}\lambda'\right)$$ using $$\lambda = 3Mg\cos\theta-\frac{2E}{r}$$ with $$E$$ the total (conserved) energy, you get $$\lambda' = -3Mg\sin\theta$$ hence the result: $$\ddot \theta = \frac{g}{r}\sin\theta$$