# Conjugate Momentum using Generalized Coordinates of Two Infinitesimally Close Points

I'm a bit stuck with the tensor analysis for the following problem. It was just introduced to me and I've never seen this before. All I'm looking for in a place to start, because I'm unsure where to even begin with this.

The distance squared between two infinitesimally close points in Cartesian coordinates is $$ds^2 = dx_1^2 + dx_2^2 + dx_3^2$$. So using the chain rule, the distance squared in general coordinates is \begin{align} ds^2 = \sum_{\alpha = 1}^3 \sum_{\beta = 1}^3 g_{\alpha \beta} du_{\alpha} du_{\beta} \end{align} where the metric tensor $$g$$ is \begin{align} g_{\alpha \beta} = \sum_{\mu = 1}^3 \dfrac{\partial x_{\mu}}{\partial u_\alpha}\dfrac{\partial x_{\mu}}{\partial u_\beta} \end{align} Note the metric tensor is a function of $$u_1$$, $$u_2$$, and $$u_3$$.

Write the Lagrangian for these coordinates, calculate the conjugate momenta in terms of the velocities, and from these calculate the Hamiltonian. Your result should be \begin{align} H = \dfrac{1}{2m} \sum_{\alpha = 1}^3 \sum_{\beta = 1}^3 p_{\alpha} g_{\alpha \beta}^{-1} p_{\beta} \end{align} where $$g^{-1}$$ is the inverse (matrix) of $$g$$

I know what to do. i.e., find the Lagrangian, take $$p_i = d\mathcal L / d \dot q$$, and use $$H = \sum_i \dot q_i p_i - \mathcal{L}$$. I'm just unsure on how to do this with the tensors. I know the first step, where $$\mathcal L = \dfrac{m}{2}\dfrac{ds^2}{dt} = \dfrac{m}{2} \sum_{\alpha = 1}^3 \sum_{\beta = 1}^3 g_{\alpha \beta} \dot u_{\alpha} \dot u_{\beta}$$ But that's as far as I can get with my math skills. Can someone point me in the right direction? Preferably to a source that does not use Einstein notation.

Thank you!

You should have $$\mathcal{L}=\frac{m}{2}g_{\alpha\beta}\dot{u}^\alpha\dot{u}^\beta$$ so $$p_\alpha=mg_{\alpha\beta}\dot{u}^\beta=m\dot{u}_\alpha$$ and $$H+\mathcal{L}=p_\alpha\dot{u}^\alpha=\frac{1}{m}p_\alpha p^\alpha$$, and the Hamiltonian and Lagrangian are each half of that. Bear in mind the index height is important; you need a metric tensor to change it. If you're shaky on tensors use matrices instead, viz. $$\mathcal{L}=\frac{m}{2}\dot{u}^T g\dot{u}$$ etc.