# How to find the equations of motion with a constraint?

I am trying to find the equation of motion for a particle constrained to move on the surface defined by $S:z=\cos x+\sin y$ under the influence of gravity. I am working in the Cartesian Coordinate system, so the force of gravity is given by $F_g=-mg\hat{k}$ where $\hat{k}$ is a unit vector in the upwards z-direction. Thus, the Lagrangian for this particle would be (I'm not sure if this is correct): $$\mathcal{L}=\frac{1}{2}m\left(\dot{x}^2+\dot{y}^2+\dot{z}^2\right)-mgz+\lambda\left(\cos x+\sin y-z\right)$$ I am using the method of lagrange multipliers to solve for the equations of motion. Is there an easier way? I then used the Euler-Lagrange equations to find my equations of motion: \begin{align} m\ddot{x}&=-\lambda\sin x\\ m\ddot{y}&=\lambda \sin y\\ m\ddot{z}&=-mg-\lambda\\ z &=\cos x +\sin y \end{align} Now, I am not really sure what I need to do with the $\lambda$. I solved for it ($\lambda=-m(g+\ddot{z})$, and substituted it in the equations, leading me to these: \begin{align} \ddot{x}&=(g+\ddot{z})\sin x \\ \ddot{y}&=(g+\ddot{z})\sin y \\ m\ddot{z}&=-mg-\lambda \end{align} But I still haven't completely isolated $\lambda$. I then differentiated the constraint with respect to time twice, $$\ddot{z}=-\left(\dot{x}^2\cos x +\dot{y}^2\sin y\right)$$ And I substituted for $\ddot{z}$ in the equation solved for $\lambda$: $$\lambda=-m\left(g-\left(\dot{x}^2\cos x +\dot{y}^2\sin y\right)\right)$$ I then eliminated $\lambda$ in the last equation: $$m\ddot{z}=-mg+m\left(g-\left(\dot{x}^2\cos x +\dot{y}^2\sin y\right)\right)$$ $$\ddot{z}=-g+\left(g-\left(\dot{x}^2\cos x +\dot{y}^2\sin y\right)\right)$$ $$\ddot{z}=-\left(\dot{x}^2\cos x +\dot{y}^2\sin y\right)$$ Here are my questions: Is all of this correct? Do you think there are analytical solutions to these differential equations?

• I thought I did? Isn't that my fourth equation of motion? – Zachary Jan 6 '18 at 3:30
• There are at least a couple of mistakes in your working. (1) Equation for $m \ddot y$ is wrong. (2) Equation for $\ddot z$ is wrong. – Myridium Jan 6 '18 at 4:15
• why don't you use coordinates adapted to the constraint instead of the cumbersome Lagrange-multipliers method? – Valter Moretti Jan 6 '18 at 11:12
• I mean, using coordinates $x$ and $y$ so that $\dot{z}=-\dot{x}\sin x + \dot{y}\cos y$ the Lagrangian reads $\frac{m}{2}[\dot{x}^2(1+ \sin^2x)] + \dot{y}^2(1+ \cos^2 y)] - mg (\cos x + \sin y)$. The equations of motion arise by the associated Euler-Lagrange equations. – Valter Moretti Jan 6 '18 at 11:16
• Also, I believe your $\ddot{z}$ equation should be: $z'' =$-x''(t) \sin (x(t))+x'(t)^2 (-\cos (x(t)))+y''(t) \cos (y(t))-y'(t)^2 \sin (y(t))$$. – Dr. Ikjyot Singh Kohli Jan 6 '18 at 14:28 ## 1 Answer Deriving twice concerning t the smooth constraint gives$$ -x''(t) \sin (x(t))-x'(t)^2 \cos (x(t))+y''(t) \cos (y(t))-y'(t)^2 \sin (y(t))-z''(t)=0 $$which jointly with$$ \left\{ \begin{array}{rcl} -\lambda \sin (x(t))-m x''(t)=0 \\ \lambda \cos (y(t))-m y''(t)=0 \\ -\lambda -g m-m z''(t)=0 \\ \end{array} \right. $$can be solved to x''(t),y''(t),z''(t),\lambda giving$$ \left\{ \begin{array}{rcl} x''(t)& = & \frac{\sin (x(t)) \left(-\cos (x(t)) x'(t)^2-\sin (y(t)) y'(t)^2+g\right)}{\cos ^2(y(t))+\sin ^2(x(t))+1} \\ y''(t)& =& \frac{\cos (y(t)) \left(\cos (x(t)) x'(t)^2+\sin (y(t)) y'(t)^2-g\right)}{\cos ^2(y(t))+\sin ^2(x(t))+1} \\ z''(t)& =& \frac{2 \left(\cos (x(t)) x'(t)^2+\sin (y(t)) y'(t)^2-g\right)}{\cos (2 x(t))-\cos (2 y(t))-4}-g \\ \lambda & =& \frac{m \left(\cos (x(t)) x'(t)^2+\sin (y(t)) y'(t)^2-g\right)}{\cos ^2(y(t))+\sin ^2(x(t))+1} \\ \end{array} \right. 

Attached the movement for initial conditions $x'(0) = y'(0)=0.01, x(0) = 0,y(0)=\pi/2$