Hamiltonian Mechanics Fundamentals The Hamiltonian $H$ is defined as $H(q, p, t) = \sum_i p_i \dot{q}_i - L(q, \dot{q}, t)$. Small Variation in Hamiltonian Consider a small variation $H \to H + \delta H$. $\delta H(q, \dot{q}, t) = \sum_i (\delta p_i \dot{q}_i + p_i \delta \dot{q}_i - \frac{\partial L}{\partial q_i} \delta q_i - \frac{\partial L}{\partial \dot{q}_i} \delta \dot{q}_i - \frac{\partial L}{\partial t} \delta t)$ Using $p_i = \frac{\partial L}{\partial \dot{q}_i}$, this simplifies to: $\delta H(q, p, t) = \sum_i (\delta p_i \dot{q}_i - \frac{\partial L}{\partial q_i} \delta q_i - \frac{\partial L}{\partial t} \delta t)$ Also, by definition of total differentiation for $H(q, p, t)$: $\delta H(q, p, t) = \sum_i (\frac{\partial H}{\partial q_i} \delta q_i + \frac{\partial H}{\partial p_i} \delta p_i) + \frac{\partial H}{\partial t} \delta t$ Hamilton's Equations Matching coefficients from the variations, we get Hamilton's Equations: $\frac{\partial H}{\partial p_i} = \dot{q}_i$ $\frac{\partial H}{\partial q_i} = -\dot{p}_i$ $\frac{\partial H}{\partial t} = -\frac{\partial L}{\partial t}$ If $L$ has no explicit time dependence, then $\frac{\partial L}{\partial t} = 0$, which implies $\frac{\partial H}{\partial t} = 0$. In this case, the Hamiltonian $H$ is conserved. Hamilton's equations form a first-order system, in contrast to the second-order Euler-Lagrange equations. Harmonic Oscillator (SHO) Examples 1. Simple Harmonic Oscillator (SHO) Lagrangian: $L = T - U = \frac{1}{2} m \dot{x}^2 - \frac{1}{2} k x^2$ Generalized Momentum: $p = \frac{\partial L}{\partial \dot{x}} = m \dot{x}$ Hamiltonian: $H = T + U = \frac{1}{2} m \dot{x}^2 + \frac{1}{2} k x^2 = \frac{p^2}{2m} + \frac{1}{2} k x^2$ Hamilton's Equations for SHO $\dot{x} = \frac{\partial H}{\partial p} = \frac{p}{m}$ $\dot{p} = -\frac{\partial H}{\partial x} = -k x$ Substituting $p = m \dot{x}$ into $\dot{p} = -k x$ gives $m \ddot{x} = -k x$. Equation of Motion: $\ddot{x} + \frac{k}{m} x = 0$ Let $\omega^2 = \frac{k}{m}$, then $\ddot{x} + \omega^2 x = 0$. This is the equation for a simple harmonic oscillator. Natural Frequency: $\omega = \sqrt{k/m}$ 2. Damped Harmonic Oscillator (DHO) Given Hamiltonian: $H = \frac{p^2}{2m} e^{\gamma t} + \frac{1}{2} m \omega^2 x^2 e^{\gamma t}$ Hamilton's Equations: $\dot{x} = \frac{\partial H}{\partial p} = \frac{p}{m} e^{\gamma t} \Rightarrow p = m \dot{x} e^{-\gamma t}$ $\dot{p} = -\frac{\partial H}{\partial x} = -m \omega^2 x e^{\gamma t}$ Substituting $p$ into $\dot{p}$: $\frac{d}{dt}(m \dot{x} e^{-\gamma t}) = -m \omega^2 x e^{\gamma t}$ $m (\ddot{x} e^{-\gamma t} - \gamma \dot{x} e^{-\gamma t}) = -m \omega^2 x e^{\gamma t}$ Dividing by $m e^{-\gamma t}$: $\ddot{x} - \gamma \dot{x} = -\omega^2 x$ Equation of Motion: $\ddot{x} - \gamma \dot{x} + \omega^2 x = 0$ (Note: the OCR image shows $\ddot{x} + \gamma \dot{x} + \omega^2 x = 0$, which implies a different Hamiltonian or a sign error in the derivation.) 3. Lagrangian for a Harmonic Oscillator Given Lagrangian: $L = \frac{1}{2} \dot{x}^2 - \frac{1}{2} \omega^2 x^2 - \alpha x^3$ Generalized Momentum: $p = \frac{\partial L}{\partial \dot{x}} = \dot{x}$ Hamiltonian: $H = p \dot{x} - L = p(p) - (\frac{1}{2} p^2 - \frac{1}{2} \omega^2 x^2 - \alpha x^3)$ $H = p^2 - \frac{1}{2} p^2 + \frac{1}{2} \omega^2 x^2 + \alpha x^3$ $H = \frac{1}{2} p^2 + \frac{1}{2} \omega^2 x^2 + \alpha x^3$ Hamiltonian in Spherical Coordinates Kinetic Energy $T = \frac{1}{2} m (\dot{r}^2 + r^2 \dot{\theta}^2 + r^2 \sin^2 \theta \dot{\phi}^2)$ Generalized Momenta: $p_r = \frac{\partial L}{\partial \dot{r}} = m \dot{r} \implies \dot{r} = \frac{p_r}{m}$ $p_\theta = \frac{\partial L}{\partial \dot{\theta}} = m r^2 \dot{\theta} \implies \dot{\theta} = \frac{p_\theta}{m r^2}$ $p_\phi = \frac{\partial L}{\partial \dot{\phi}} = m r^2 \sin^2 \theta \dot{\phi} \implies \dot{\phi} = \frac{p_\phi}{m r^2 \sin^2 \theta}$ Potential Energy: $U = U(r, \theta, \phi)$ Hamiltonian: $H = \sum_i p_i \dot{q}_i - L = T + U$ (since $L = T-U$ and $H$ is time-independent) $H = \frac{1}{2m} (p_r^2 + \frac{p_\theta^2}{r^2} + \frac{p_\phi^2}{r^2 \sin^2 \theta}) + U(r, \theta, \phi)$ Hamilton's Equations in Spherical Coordinates $\dot{r} = \frac{\partial H}{\partial p_r} = \frac{p_r}{m}$ $\dot{\theta} = \frac{\partial H}{\partial p_\theta} = \frac{p_\theta}{m r^2}$ $\dot{\phi} = \frac{\partial H}{\partial p_\phi} = \frac{p_\phi}{m r^2 \sin^2 \theta}$ $\dot{p_r} = -\frac{\partial H}{\partial r} = \frac{p_\theta^2}{m r^3} + \frac{p_\phi^2}{m r^3 \sin^2 \theta} - \frac{\partial U}{\partial r}$ $\dot{p_\theta} = -\frac{\partial H}{\partial \theta} = \frac{p_\phi^2 \cos \theta}{m r^2 \sin^3 \theta} - \frac{\partial U}{\partial \theta}$ $\dot{p_\phi} = -\frac{\partial H}{\partial \phi} = -\frac{\partial U}{\partial \phi}$ Euler Angles (Symmetric Top) For a system with Lagrangian $L(\theta, \phi, \psi)$ (Euler angles), the Hamiltonian can be complex. For a symmetric top with $I_1=I_2 \neq I_3$, the Lagrangian is: $L = \frac{1}{2} I_1 (\dot{\theta}^2 + \dot{\phi}^2 \sin^2 \theta) + \frac{1}{2} I_3 (\dot{\psi} + \dot{\phi} \cos \theta)^2 - Mgl \cos \theta$ Generalized Momenta: $p_\theta = \frac{\partial L}{\partial \dot{\theta}} = I_1 \dot{\theta}$ $p_\phi = \frac{\partial L}{\partial \dot{\phi}} = I_1 \dot{\phi} \sin^2 \theta + I_3 (\dot{\psi} + \dot{\phi} \cos \theta) \cos \theta$ $p_\psi = \frac{\partial L}{\partial \dot{\psi}} = I_3 (\dot{\psi} + \dot{\phi} \cos \theta)$ From $p_\psi$, we have $\dot{\psi} + \dot{\phi} \cos \theta = \frac{p_\psi}{I_3}$. Substitute this into $p_\phi$: $p_\phi = I_1 \dot{\phi} \sin^2 \theta + p_\psi \cos \theta \implies \dot{\phi} = \frac{p_\phi - p_\psi \cos \theta}{I_1 \sin^2 \theta}$ Then $\dot{\psi} = \frac{p_\psi}{I_3} - \dot{\phi} \cos \theta = \frac{p_\psi}{I_3} - \frac{p_\phi - p_\psi \cos \theta}{I_1 \sin^2 \theta} \cos \theta$ Hamiltonian: $H = \frac{p_\theta^2}{2I_1} + \frac{(p_\phi - p_\psi \cos \theta)^2}{2I_1 \sin^2 \theta} + \frac{p_\psi^2}{2I_3} + Mgl \cos \theta$ 1D Hamiltonian and Lagrangian Relationship Given $H = \frac{p^2}{2m} e^{x/a} + U(x)$. Find Lagrangian $L$. From Hamilton's equations: $\dot{x} = \frac{\partial H}{\partial p} = \frac{p}{m} e^{x/a} \implies p = m \dot{x} e^{-x/a}$ $L = p \dot{x} - H = (m \dot{x} e^{-x/a}) \dot{x} - (\frac{(m \dot{x} e^{-x/a})^2}{2m} e^{x/a} + U(x))$ $L = m \dot{x}^2 e^{-x/a} - (\frac{m^2 \dot{x}^2 e^{-2x/a}}{2m} e^{x/a} + U(x))$ $L = m \dot{x}^2 e^{-x/a} - (\frac{1}{2} m \dot{x}^2 e^{-x/a} + U(x))$ $L = \frac{1}{2} m \dot{x}^2 e^{-x/a} - U(x)$ System with $H(x,p) = -[p^2 + V(x)]^{-1/2}$ Find Lagrangian $L$. $\dot{x} = \frac{\partial H}{\partial p} = - (-\frac{1}{2}) [p^2 + V(x)]^{-3/2} (2p) = p [p^2 + V(x)]^{-3/2}$ So, $\dot{x}^2 = p^2 [p^2 + V(x)]^{-3}$ Rearranging to find $p^2$ in terms of $\dot{x}^2$ and $V(x)$ is complex. A more direct path is to use $L = p \dot{x} - H$. From $\dot{x} = p (p^2+V(x))^{-3/2}$, we have $p^2 = \dot{x}^2 (p^2+V(x))^3$. This is not straightforward to solve for $p$. Let's check the provided solution steps in the OCR. The OCR seems to derive $p^2 = \frac{V(x) \dot{x}^2}{1-\dot{x}^2}$ and then $p = \pm \frac{\sqrt{V(x)} \dot{x}}{\sqrt{1-\dot{x}^2}}$. Let's assume the relation $p = \frac{\dot{x}}{\sqrt{1-\dot{x}^2}} \sqrt{V(x)}$ is correct for a specific scenario, then: $L = p \dot{x} - H = \frac{\dot{x}^2 \sqrt{V(x)}}{\sqrt{1-\dot{x}^2}} - (-\frac{1}{\sqrt{p^2+V(x)}})$ If $H = V(x) \sqrt{1-\dot{x}^2}$, then $p = \frac{\partial L}{\partial \dot{x}} = \frac{V(x) \dot{x}}{\sqrt{1-\dot{x}^2}}$. Then $H = p \dot{x} - L = \frac{V(x) \dot{x}^2}{\sqrt{1-\dot{x}^2}} - V(x) \sqrt{1-\dot{x}^2} = \frac{V(x) \dot{x}^2 - V(x)(1-\dot{x}^2)}{\sqrt{1-\dot{x}^2}} = \frac{V(x) (\dot{x}^2 - 1 + \dot{x}^2)}{\sqrt{1-\dot{x}^2}} = \frac{V(x) (2\dot{x}^2-1)}{\sqrt{1-\dot{x}^2}}$. This does not match the given $H$. Let's re-evaluate the OCR's derivation for $L$. From $\dot{x} = p(p^2+V(x))^{-3/2}$, $p^2 = \dot{x}^2 (p^2+V(x))^3$. This is not directly useful. The OCR shows $p^2 = (p^2+V(x))\dot{x}^2$. This means $p^2(1-\dot{x}^2) = V(x)\dot{x}^2$, so $p^2 = \frac{V(x)\dot{x}^2}{1-\dot{x}^2}$. This implies $\dot{x}^2 Then $H = p \dot{x} - L$. Substituting $p$: $\frac{V(x)\dot{x}^2}{1-\dot{x}^2} = p^2$. Now, $p^2+V(x) = \frac{V(x)\dot{x}^2}{1-\dot{x}^2} + V(x) = V(x) (\frac{\dot{x}^2 + 1 - \dot{x}^2}{1-\dot{x}^2}) = \frac{V(x)}{1-\dot{x}^2}$. So $H = -[p^2+V(x)]^{-1/2} = -[\frac{V(x)}{1-\dot{x}^2}]^{-1/2} = -\frac{\sqrt{1-\dot{x}^2}}{\sqrt{V(x)}}$. Now calculate $L = p \dot{x} - H = \frac{\dot{x}\sqrt{V(x)}}{\sqrt{1-\dot{x}^2}} \dot{x} - (-\frac{\sqrt{1-\dot{x}^2}}{\sqrt{V(x)}})$ $L = \frac{\dot{x}^2 \sqrt{V(x)}}{\sqrt{1-\dot{x}^2}} + \frac{\sqrt{1-\dot{x}^2}}{\sqrt{V(x)}} = \frac{\dot{x}^2 V(x) + (1-\dot{x}^2)}{ \sqrt{V(x)}\sqrt{1-\dot{x}^2}}$. This is complex. The OCR shows $L = V(x) (1-\dot{x}^2)^{1/2}$. Let's verify this. $p = \frac{\partial L}{\partial \dot{x}} = V(x) \frac{1}{2} (1-\dot{x}^2)^{-1/2} (-2\dot{x}) = -\frac{V(x)\dot{x}}{\sqrt{1-\dot{x}^2}}$ (Note: The OCR derived $p$ with a positive sign, indicating a potential sign discrepancy.) If $p = \frac{V(x)\dot{x}}{\sqrt{1-\dot{x}^2}}$, then $L$ would be $L = -V(x) \sqrt{1-\dot{x}^2}$. Let's use this $L = -V(x) \sqrt{1-\dot{x}^2}$ to calculate $H$: $p = \frac{V(x)\dot{x}}{\sqrt{1-\dot{x}^2}} \implies p^2 = \frac{V(x)^2 \dot{x}^2}{1-\dot{x}^2}$ $p \dot{x} = \frac{V(x)\dot{x}^2}{\sqrt{1-\dot{x}^2}}$ $H = p \dot{x} - L = \frac{V(x)\dot{x}^2}{\sqrt{1-\dot{x}^2}} - (-V(x) \sqrt{1-\dot{x}^2}) = \frac{V(x)\dot{x}^2 + V(x)(1-\dot{x}^2)}{\sqrt{1-\dot{x}^2}} = \frac{V(x)}{\sqrt{1-\dot{x}^2}}$ This is still not equal to the original $H = -[p^2+V(x)]^{-1/2}$. There appears to be an inconsistency in the OCR's derivation or the problem statement itself. Given the OCR's final form $L = V(x) (1-x^2)^{1/2}$, this looks like a relativistic Lagrangian where $V(x)$ plays the role of $mc^2$ and $x$ is $\dot{q}/c$. The initial $H$ looks like $-1/\sqrt{E^2-p^2}$. This is a very specific context, and without clarification, it's hard to reconcile the steps. Conserved Quantities If the Lagrangian does not explicitly depend on a generalized coordinate $q_k$, i.e., $\frac{\partial L}{\partial q_k} = 0$, then the generalized momentum $p_k = \frac{\partial L}{\partial \dot{q}_k}$ is conserved. Example: $L = \frac{1}{2} m r^2 [\dot{\theta}^2 + \sin^2 \theta \dot{\phi}^2] - mgl \cos \theta$ Here, $L$ does not depend on $\phi$ (i.e., $\frac{\partial L}{\partial \phi} = 0$). Therefore, $p_\phi = \frac{\partial L}{\partial \dot{\phi}} = m r^2 \sin^2 \theta \dot{\phi}$ is a conserved quantity.