# How is the multidimensional Lagrangian-function partially derived here? Chain-Rule and?

I want to understand the following:

The coordinates in our original coordination system are:

$$\vec x = (x_1,..., x_{3N})^T,\dot{\vec x} = (\dot x_1,..., \dot x_{3N})^T$$

We want to use generalized coordinates: $$\vec q = (q_1,..., q_{3N})^T,\dot{\vec q} = (\dot q_1,..., \dot q_{3N})^T$$

The Lagrangian-function is given by $$L=L(\vec x,\dot{\vec x} , t)=L(\vec x(\vec q),\dot{\vec x}(\vec q, \dot{\vec q},t) , t)$$

So $$L: \mathbb{R}^{3N}\times \mathbb{R}^{3N}\times \mathbb{R}^+ \rightarrow \mathbb{R}$$

I haven't had any multidimensional analysis yet, so it's difficult for me to understand the following partial derivative:

$$\frac{\partial L}{\partial \dot q_j}=\sum_{i=1}^{3N}(\frac{\partial L}{\partial x_i}\frac{\partial x_i}{\partial \dot q_j} + \frac{\partial L}{\partial \dot x_i}\frac{\partial \dot x_i}{\partial \dot q_j})$$

Can somebody explain to me, what has been done here?

It looked a bit like the chain-rule, so I read this section: https://en.wikipedia.org/wiki/Chain_rule#General_rule

What I find confusing, is that I can't identify an $$f$$ and $$g$$, if you interpret $$\vec x:\mathbb{R}^{3N}\rightarrow \mathbb{R}^{3N}, \vec q\mapsto \vec x(\vec q)$$ as a function and $$L: \mathbb{R}^{3N}\rightarrow \mathbb{R}, \vec q\mapsto L(\vec x(\vec q))$$

$$D(L\circ x)=D_L\cdot D_x\\ =\begin{pmatrix} \frac{\partial L}{\partial x_1}L(\vec x) & ... & \frac{\partial L}{\partial x_{3N} }L(\vec x)\end{pmatrix}\cdot \begin{pmatrix} \frac{\partial x_1}{\partial \dot q_1} & ... & \frac{\partial x_1}{\partial \dot q_{3N} } \\ \vdots &... & \vdots \\ \frac{\partial x_{3N}}{\partial \dot q_1} & ... & \frac{\partial x_{3N}}{\partial \dot q_{3N} }\end{pmatrix}\\ =(\sum_{i=1}^{3N} \frac{\partial L}{\partial x_i}L(\vec x)\cdot \frac{\partial x_{i}}{\partial \dot q_1},...,\sum_{i=1}^{3N} \frac{\partial L}{\partial x_i}L(\vec x)\cdot \frac{\partial x_{i}}{\partial \dot q_{3N}})$$

Analogue for $$\dot x$$: $$D(L\circ \dot x)=D_L\cdot D_{\dot x}\\= \begin{pmatrix} \frac{\partial L}{\partial \dot x_1}L(\dot{\vec x}) & ... & \frac{\partial L}{\partial \dot x_{3N} }L(\dot{\vec x})\end{pmatrix}\cdot \begin{pmatrix} \frac{\partial \dot x_1}{\partial \dot q_1} & ... & \frac{\partial \dot x_1}{\partial \dot q_{3N} }\\ \vdots &... & \vdots \\ \frac{\partial \dot x_{3N}}{\partial \dot q_1} & ... & \frac{\partial \dot x_{3N}}{\partial \dot q_{3N} }\end{pmatrix}\\ =(\sum_{i=1}^{3N} \frac{\partial L}{\partial \dot x_i}L(\dot{\vec x})\cdot \frac{\partial \dot x_{i}}{\partial \dot q_1},...,\sum_{i=1}^{3N} \frac{\partial L}{\partial \dot x_i}L(\dot{\vec x} )\cdot \frac{\partial \dot x_{i}}{\partial \dot q_{3N}})$$

So if I add my results, I get ALMOST the given form when comparing the components, the differences are the factors $$L(\dot{\vec x}), L(\vec x)$$:

$$D(L\circ x)+D(L\circ \dot x)=(\sum_{i=1}^{3N} \frac{\partial L}{\partial x_i}L(\vec x)\cdot \frac{\partial x_{i}}{\partial \dot q_1},...,\sum_{i=1}^{3N} \frac{\partial L}{\partial x_i}L(\vec x)\cdot \frac{\partial x_{i}}{\partial \dot q_{3N}})+(\sum_{i=1}^{3N}\frac{\partial L}{\partial \dot x_i}L(\dot{\vec x})\cdot \frac{\partial \dot x_{i}}{\partial \dot q_1},...,\sum_{i=1}^{3N} \frac{\partial L}{\partial \dot x_i}L(\dot{\vec x} )\cdot \frac{\partial \dot x_{i}}{\partial \dot q_{3N}})$$

AND I can't explain why I should add $$D(L\circ x)$$and $$D(L\circ \dot x)$$?

• Are you sure that $\vec x$ is only a function of $\vec q$ and does not depend on $\dot{\vec q}$? In that case $\frac{\partial x_i}{\partial \dot q_j} = 0$. What is the source of the formula? Oct 2, 2022 at 14:31
• I understand, why $\frac{\partial x_i}{\partial \dot q_j} = 0$ has to be true, if there is no dependency of $\vec x$ from $\dot{\vec{q}}$. The source of the formula is a scipt about analytical mechanics, more specifc: It is a chapter about the invariance of the Euler-Lagrange-Equations if you change the coordinates from cartesian to generalized coordinates. My question relates to the proof of this fact. Oct 2, 2022 at 18:42
Let us write more generally $$\vec x = \vec x(\vec q, \dot{\vec q},t)$$. I do not know whether it makes sense physically that we assume a dependency of $$\vec x$$ from $$\dot{\vec q}$$ and $$t$$, but formally it is certainly okay. If $$\vec x$$ only depends on $$\vec q$$, then we get $$\dfrac{\partial x_i}{\partial \dot{\vec q_j}} = 0$$ and $$\dfrac{\partial x_i}{\partial t} = 0$$ which leads to the formula $$\frac{\partial L}{\partial \dot q_j}=\sum_{i=1}^{3N}\frac{\partial L}{\partial \dot x_i}\frac{\partial \dot x_i}{\partial \dot q_j} .$$ So let us consider the function $$\tilde L(\vec q, \dot{\vec q},t) = L(\vec x(\vec q, \dot{\vec q},t),\dot{\vec x}(\vec q, \dot{\vec q},t), t)$$ defined on $$\mathbb R^{3N} \times \mathbb R^{3N} \times \mathbb R^+$$. Note that I wrote $$\tilde L$$ to distinguish it from $$L$$ which is a function of $$\vec x, \dot{\vec x},t$$. We have $$\tilde L = L \circ X$$ where $$X : \mathbb R^{3N} \times \mathbb R^{3N} \times \mathbb R^+ \to \mathbb R^{3N} \times \mathbb R^{3N} \times \mathbb R^+$$ is given by $$X(\vec q, \dot{\vec q},t) = (\vec x(\vec q, \dot{\vec q},t),\dot{\vec x}(\vec q, \dot{\vec q},t), t)$$.
Since we are only interested in the partial derivatives with respect to the $$\dot{\vec q_j}$$, we simplify notation by ignoring the variables $$\vec q$$ and $$t$$. That is, we consider the functions $$\vec x = \vec x(\dot{\vec q}) ,$$ $$\dot{\vec x} = \dot{\vec x}(\dot{\vec q}) ,$$ $$L(\vec x,\dot{\vec x}) ,$$ $$\tilde L(\dot{\vec q}) = L(\vec x(\dot{\vec q}),\dot{\vec x}(\dot{\vec q})) ,$$ $$X(\dot{\vec q}) = (\vec x(\dot{\vec q}),\dot{\vec x}(\dot{\vec q})) .$$
The chain rule tells us that the Jacobian matrix of $$\tilde L$$ at a point $$\dot{\vec q} \in \mathbb R^{3N}$$ $$J \tilde L (\dot{\vec q}) = \begin{pmatrix} \dfrac{\partial \tilde L}{\partial \dot q_1}(\dot{\vec q}) & \dots & \dfrac{\partial \tilde L}{\partial \dot q_{3N}}(\dot{\vec q}) \end{pmatrix}$$ is the product $$JL(X(\dot{\vec q})) \circ JX(\dot{\vec q})$$ of the Jacobians of $$L$$ and $$X$$. Suppressing the argument $$\dot{\vec q}$$ on the RHS we get $$JL(X(\dot{\vec q})) = \begin{pmatrix} \dfrac{\partial L}{\partial x_1} & \dots & \dfrac{\partial L}{\partial x_{3N}} & \dfrac{\partial L}{\partial \dot x_1} & \dots & \dfrac{\partial L}{\partial \dot x_{3N}} \end{pmatrix}$$ $$JX(\dot{\vec q}) = \begin{pmatrix} \dfrac{\partial x_1}{\partial \dot q_1} & \dots & \dfrac{\partial x_1}{\partial \dot q_{3N}} \\ \dots & \dots & \dots \\ \dfrac{\partial x_{3N}}{\partial \dot q_1} & \dots & \dfrac{\partial x_{3N}}{\partial \dot q_{3N}} \\ \dfrac{\partial \dot x_1}{\partial \dot q_1} & \dots & \dfrac{\partial \dot x_1}{\partial \dot q_{3N}} \\ \dots & \dots & \dots \\ \dfrac{\partial \dot x_{3N}}{\partial \dot q_1} & \dots & \dfrac{\partial \dot x_{3N}}{\partial \dot q_{3N}} \end{pmatrix}$$ A simple matrix multiplication shows then that $$\frac{\partial \tilde L}{\partial \dot q_j}=\sum_{i=1}^{3N}(\frac{\partial L}{\partial x_i}\frac{\partial x_i}{\partial \dot q_j} + \frac{\partial L}{\partial \dot x_i}\frac{\partial \dot x_i}{\partial \dot q_j}) .$$