0

I am taking Analytical Mechanics course in this semester, and I came across a point that made me doubt my understanding of partial and total derivatives (please forgive me if my question is too basic - this is why I don't want to ask my professor):

We are given a function $f(q_1(t),q_2(t),...,q_n(t))$, so there is no explicit dependency on t (only implicit dependency).

I read that if we take the partial derivative of f with respect to t, we get 0. This was weird for me, since if we change t, then $q_i(t)$ must also change, and so I expected we would get some sort of chain rule ( But it seems like $\frac{\partial f}{\partial t}=\frac{\partial f}{\partial q_i}\frac{\partial q_i}{\partial t}$ is not the answer - and is the total derivative).

I read some posts in MSE and my books on calculus, and it seems that I should define the following functions: $f:\mathbb{R}\rightarrow\mathbb{R}; f(t)$, $g:\mathbb{R}\rightarrow\mathbb{R}^n; g(t)=(q_1(t),...,q_n(t))$ and $F:\mathbb{R}^n\rightarrow\mathbb{R}; F(q_1,...,q_n)$. then $f(t)=F \circ g$. We get by the chain rule that $\frac{\partial f}{\partial t}=(\frac{\partial F}{\partial q_1},...,\frac{\partial F}{\partial q_n})\cdot(\frac{\partial q_1}{\partial t},...,\frac{\partial q_n}{\partial t})$, which is not necessarily zero.

So why do we get 0 if we take $\frac{\partial f}{\partial t}$ when a function does not have an explicit dependency on t, even though it might have an implicit dependency? Could you explain why it happens using the formal definition of the partial derivative?

I am adding a picture from the book Hand & Finch from page 21 to add further detail to my question enter image description here

Thank you in advance!

R24698
  • 352
  • 1
    You were doing so well till you brought up Hand & Finch… physics books are the fastest way to get confused on such basic matters. Jokes aside, I’ll answer shortly after looking through some answers (which I’m sure I’ve written about). – peek-a-boo Jan 07 '24 at 07:27
  • 1
    I don't understand your question. As you have (correctly) written it, $f$ does depend explicitly on $t$; it is $F$ which depends implicitly on $t$. – ancient mathematician Jan 07 '24 at 07:28
  • 1
    btw, you shouldn’t write $\frac{\partial f}{\partial t}$, you should simply write $\frac{df}{dt}$, or $f’(t)$ since you’re dealing with a function of one variable. Also, this $f’(t)$ is not necessarily zero. What people do say is that since $F$ is a map $F:\Bbb{R}^n\to\Bbb{R}$ rather than $\tilde{F}:\Bbb{R}^n\times\Bbb{R}\to\Bbb{R}$, ‘$\tilde{F}$ does not explicitly depend on time’ (or by abuse of language, $F$ does not depend explicitly on time and would write $\frac{\partial F}{\partial t}=0$). Does this clarify things somewhat more? – peek-a-boo Jan 07 '24 at 07:32
  • @peek-a-boo Thank you for helping! it does clarify things, but I am still not sure why $\frac{\partial F}{\partial t}$ is zero in the case presented in H&F (i.e. why $\frac{\partial L}{\partial t}=0$)... The coordinates $q_1,...,q_n$ are all dependent on t, so how can we treat $L$ once as if it doesn't have an explicit dependency on t, but then even take the total derivative with respect to t? – R24698 Jan 07 '24 at 07:57

1 Answers1

1

Let $L:\Bbb{R}^n\times\Bbb{R}^n\times\Bbb{R}\to\Bbb{R}$ be a given smooth map. I’m going to use the notation $(x,v,t)$ to denote a point in $\Bbb{R}^n\times\Bbb{R}^n\times\Bbb{R}$. I hope you agree that we can now consider the $2n+1$ many partial derivative functions $\frac{\partial L}{\partial x^1},\dots \frac{\partial L}{\partial x^n}, \frac{\partial L}{\partial v^1},\dots \frac{\partial L}{\partial v^n},\frac{\partial L}{\partial t}: \Bbb{R}^n\times\Bbb{R}^n\times\Bbb{R}\to\Bbb{R}$. Don’t get ‘confused’ by the notation $x^i,v^i,t$. So far there’s nothing at all to suggest anything means position, velocities, time or Lagrangian. I just have a function of $(2n+1)$ many variables in the domain and as output I spit out a real number, and I can consider the corresponding partial derivatives.

From the given map $L$, I’m going to define a new map $E:\Bbb{R}^n\times\Bbb{R}^n\times\Bbb{R}\to\Bbb{R}$ by the formula \begin{align} E(x,v,t):=\sum_{i=1}^nv^i\frac{\partial L}{\partial v^i}\bigg|_{(x,v,t)} - L(x,v,t)\tag{1.6.5} \end{align} (and as mentioned in the link, I really would like to avoid $H$ here because that’s again another source for confusion; the function $E$ here is intuitively ‘defined in terms of positions and velocities’, rather than ‘position and momenta’, i.e this is a Physics issue which hand & Finch should emphasize (I hope they did)). So far all I did is start with one function $L$, and used it to construct a new function $E$. Nothing magical here.

Next, suppose we have a smooth function $\gamma:\Bbb{R}\to\Bbb{R}^n$ such that for all $i\in\{1,\dots, n\}$ and all $t\in\Bbb{R}$ \begin{align} \frac{d}{dt}\bigg(\frac{\partial L}{\partial v^i}\bigg|_{(\gamma(t),\dot{\gamma}(t),t)}\bigg)-\frac{\partial L}{\partial x^i}\bigg|_{(\gamma(t),\dot{\gamma}(t),t)}&=0.\tag{$*$} \end{align} See here (and the sublinks within) for a more detailed explanation of what exactly we mean here with the Euler-Lagrange equations, if you need it.

Ok perfect, so we now have three functions $L,E,\gamma$ in play here. Let me now define two new function $L_{\gamma},E_{\gamma}:\Bbb{R}\to\Bbb{R}$ as the following composition: \begin{align} L_{\gamma}(t):=L(\gamma(t),\dot{\gamma}(t),t),\quad\text{and}\quad E_{\gamma}(t)&:=E(\gamma(t),\dot{\gamma}(t),t)\\ &=\sum_{i=1}^n\dot{\gamma}^i(t)\frac{\partial L}{\partial v^i}\bigg|_{(\gamma(t),\dot{\gamma}(t),t)}- L_{\gamma}(t). \end{align} Note that the final equal sign simply used the definitions. Now we can start differentiating things \begin{align} E_{\gamma}’(t)&=\frac{d}{dt}\left(\sum_{i=1}^n\dot{\gamma}^i(t)\frac{\partial L}{\partial v^i}\bigg|_{(\gamma(t),\dot{\gamma}(t),t)}- L_{\gamma}(t)\right)\\ &=\left[\sum_{i=1}^n\ddot{\gamma}^i(t)\frac{\partial L}{\partial v^i}\bigg|_{(\gamma(t),\dot{\gamma}(t),t)}+\sum_{i=1}^n\dot{\gamma}^i(t)\frac{d}{dt}\left(\frac{\partial L}{\partial v^i}\bigg|_{(\gamma(t),\dot{\gamma}(t),t)}\right)\right]\\ &\,\,\,-\left[\sum_{i=1}^n\frac{\partial L}{\partial x^i}\bigg|_{(\gamma(t),\dot{\gamma}(t),t)}\cdot\dot{\gamma}^i(t)+ \sum_{i=1}^n\frac{\partial L}{\partial v^i}\bigg|_{(\gamma(t),\dot{\gamma}(t),t)}\cdot\ddot{\gamma}^i(t) + \frac{\partial L}{\partial t}\bigg|_{(\gamma(t),\dot{\gamma}(t),t)}\cdot 1\right]\\ &=-\frac{\partial L}{\partial t}\bigg|_{(\gamma(t),\dot{\gamma}(t),t)}. \end{align} The first square brackets just used the product rule and the second square brackets just used the chain rule (see this answer for remarks on how to write the chain rule from most precise to least precise, notation-wise). To get from the second to third equal sign, note that the first term cancels with the fourth, and after using the Euler-Lagrange equations (*) for the second term it cancels with the third term. Hence, we get our desired result: \begin{align} E_{\gamma}’(t)&=-\frac{\partial L}{\partial t}\bigg|_{(\gamma(t),\dot{\gamma}(t),t)}\tag{1.6.8} \end{align} So, if you’re so lazy as to omit all instances of the curve $\gamma$, then you could write this as the confusing equality $\frac{dE}{dt}=-\frac{\partial L}{\partial t}$.

In the comments, you ask

so how can we treat $L$ once as if it doesn't have an explicit dependency on $t$, but then even take the total derivative with respect to $t$

I hope you’re now convinced that is not what we’re doing. You’re getting confused because you (because of the book) keep using the same letter $L$ to mean different things. For the function $L$, I can (as I mentioned in the very first paragraph), consider any of its $(2n+1)$ many partial derivatives, in particular its last one $\frac{\partial L}{\partial t}$. The function $L_{\gamma}$ is a completely different function from $L$ (it has a different domain $\Bbb{R}$ vs $\Bbb{R}^n\times\Bbb{R}^n\times\Bbb{R}$) obtained via composition; and it is a function of only one variable so I can only consider its derivative $L_{\gamma}’$ (i.e $\frac{dL_{\gamma}}{dt}$), and to relate $L_{\gamma}’$ to the various partials derivatives of $L$, I simply use the chain rule.

The ultimate theorem is saying that if $\frac{\partial L}{\partial t}=0$ identically, then for every curve $\gamma$ satisfying the Euler-Lagrange equations (*), we have $E_{\gamma}’=0$, and hence $E_{\gamma}$ is a constant function (i.e energy is conserved).


A very common situation which arises is we first start with a smooth function $L_0:\Bbb{R}^n\times\Bbb{R}^n\to\Bbb{R}$. Then, we define a new function $L: \Bbb{R}^n\times\Bbb{R}^n\times\Bbb{R}\to\Bbb{R} $ by the formula $L(x,v,t):=L_0(x,v)$. So, clearly, the value of $L(x,v,t)$ does not depend on $t$, and thus $\frac{\partial L}{\partial t}=0$ identically, so in this case, we have energy conservation (i.e $E_{\gamma}$ is constant, where $E$ and $E_{\gamma}$ have been defined above in terms of $L$).


peek-a-boo
  • 55,725
  • 2
  • 45
  • 89
  • Thank you for your great comment! Another post of yours that really helped is at (for anyone who might find additional refrences useful) https://math.stackexchange.com/questions/3266639/notation-for-partial-derivative-of-functions-of-functions/3270436#3270436. – R24698 Jan 07 '24 at 15:50
  • I have a follow-up question: In the next lecture, we proved Euler's theorem for homogeneous functions. we stated the theorem the following way: let $f(\alpha x)=\alpha^kf(x)$. Then $\sum_{i} x_i\frac{\partial f}{\partial x_i} = kf$ ($x \in \mathbb{R}^n$). We proved it by differentiating w/r to $\alpha$. the professor wrote this line at some point: $\frac{\partial f(\alpha x)}{\partial \alpha} = \sum_{i} \frac{\partial f}{\partial \alpha x_i} \cdot x_i$. From your answers that I read, I think that the notation $\frac{\partial f}{\partial \alpha x_i}$ is weird... (cont. in next comment) – R24698 Jan 08 '24 at 18:25
  • Won't it be better if we write something like this instead: first, define three functions: $f:\mathbb{R}\rightarrow\mathbb{R}$, $g:\mathbb{R} \times \mathbb{R}^n\rightarrow\mathbb{R}; g(\alpha,x)=\alpha \cdot x$, $h:\mathbb{R} \times \mathbb{R}^n\rightarrow\mathbb{R}; h(\alpha)=f(g(\alpha,x))$, and then $\frac{\partial h}{\partial \alpha}=\frac{df}{d\zeta} \bigg|{\zeta = \alpha x} \cdot \frac{\partial g}{\partial \alpha} \bigg|{(\alpha,x)}$ (and we use total derivative of $f$ because it is a function of a single variable (please correct me if I'm wrong)). – R24698 Jan 08 '24 at 18:27
  • I've reread the second comment and realized that $g$ is actually $g:\mathbb{R} \times \mathbb{R}^n\rightarrow\mathbb{R^n}$, and that $f$ is $f:\mathbb{R^n}\rightarrow\mathbb{R}$, so I guess this answers my question about the total derivative - we have to take that partial(?)... oops. – R24698 Jan 08 '24 at 18:40
  • 1
    in your first comment, that’s terrible notation. Second comment, things don’t match up. it should be a given differentiable function $f:\Bbb{R}^n\to V$ (the target space $V$ can be any real vector space), and $g:\Bbb{R}\times\Bbb{R}^n\to\Bbb{R}^n$, $g(\alpha,x)=\alpha x$, and $h:\Bbb{R}\times\Bbb{R}^n\to V$, given by $h(\alpha,x)=f(g(\alpha,x))$. Then, taking the partial derivative, you should get $\frac{\partial h}{\partial \alpha}(\alpha,x)=\frac{\partial f}{\partial x^i}\bigg|_{g(\alpha,x)}\cdot\frac{\partial g^i}{\partial \alpha}(\alpha,x)$. Evaluate everything now at $\alpha=1$. – peek-a-boo Jan 08 '24 at 18:41
  • I agree that in the first comment, the notation is terrible... Physicists are too lazy. Thank you very much, I guess this kind of mistake happens after sleeping 5 hours... – R24698 Jan 08 '24 at 18:44
  • Sorry to bother you again. I reread your answer I mentioned in the comments and the explantion to this question, and hope you could clarify something: If the function $f$ (for example, $f=f(x(t),y(t))$) does not have explicit dependency of $t$, I am still not sure why its partial derivative with respect to t is zero, since if we change t, $x(t)$ and $y(t)$ change as well, so the limit of $\frac{f(x(t+h),y(t+h))-f(x(t),y(t))}{h}$ is not necessarily zero. In my understanding, if we say that we take the partial derivative with respect to t, the arguments of x(t) and y(t) should change as well. – R24698 Jan 08 '24 at 20:13
  • Is it because (as you said in the mentioned answer) we change one of the arguments (first or second), and here $\frac{\partial f}{\partial t}$ is just bad notation for saying "take the partial derivative of something which has no variable correspoding to t"? For example, in the mentioned answer, we had $\frac{\partial f(x(t),t)}{\partial t}"="\partial_2{f(x(t),t)}$ which means take the partial derivative with respect to the second variable (which was called t) and in the current case we don't have $t$ as our second variable, so the result is just 0? – R24698 Jan 08 '24 at 20:37
  • Why do you insist on writing things like $f= f(x(t), y(t))$, which as I’ve told you, and as you wrote in your own post, makes no sense. Second, this composed function is not the same as $f$. Stop using sloppy notation and incorrect language and youll be more than halfway there. Reread all the answers and links, take a break if necessary. – peek-a-boo Jan 08 '24 at 20:44
  • 1
    There’s a reason why Ive been extremely insistent on using different notation for a function and its various compositons ($E$ vs $E_{\gamma}$ for example). You have a function $f: R^2\to R$, which you’ve decided to denote the inputs as $(x,y)$, so a partial derivative with respect to “$t$” is completely meaningless. It’s not even a question of whether it is zero or not; it is just completely meaningless, like asking what is potato plus spongebob. – peek-a-boo Jan 08 '24 at 20:47
  • You’re essentially asking what’s in this answer. – peek-a-boo Jan 08 '24 at 20:51
  • I read your answers again, but I am still a bit confused. If you notice that I've used bad notation or language, please correct me, since I'm not confident about this yet: I understand that the notation "$f=f(x(t),y(t))$" is not good since the function is a composition of functions - $f:\mathbb{R^2}\rightarrow\mathbb{R}; f(x,y)$,$g:\mathbb{R}\rightarrow\mathbb{R^2}; g(t)=(x(t),y(t))$, $h:\mathbb{R}\rightarrow\mathbb{R}; h(t)=f(g(t))$. (cont. in next comment) – R24698 Jan 09 '24 at 18:39
  • The difference between this case and the following is not clear to me: Consider $f:\mathbb{R^2}\rightarrow\mathbb{R}$; $f(x,y)$, $g:\mathbb{R^2}\rightarrow\mathbb{R^2}$; $g(u,v)=(x(u,v),y(u,v))$, $h:\mathbb{R^2}\rightarrow\mathbb{R}$; $h(u,v)=f(g(u,v))$. From what I know from beforehand and understanding of your answers, $\frac{\partial h}{\partial u}(u,v) = \frac{\partial f}{\partial x}(x(u,v), y(u,v)) \cdot \frac{\partial x}{\partial u}(u,v) + \frac{\partial f}{\partial y}(x(u,v), y(u,v)) \cdot \frac{\partial y}{\partial u}(u,v)$. (cont. in next comment) – R24698 Jan 09 '24 at 18:40
  • Now I don't unsertand why $\frac{\partial h}{\partial u}(u,v)$ is not zero, but according to our logic from before (I understand that the following notation is wrong, I am using it to make a point), $\frac{\partial f(x(u,v),y(u,v))}{\partial u}=0$, becuase we take the partial derivative of $f$ not as a composite function (as in $\frac{\partial h}{\partial u}(u,v)$), but as somthing like $F(x,y,u):=f(x(u,v),y(u,v)$, and then $\frac{\partial F}{\partial u}(u,v)=0$, becuase we mean "take the partial derivative w/r to the third argument", or in your notation: ${\partial_3 {F(x,y,u)}}=0$ – R24698 Jan 09 '24 at 18:40
  • (which could be shown from the definition as a limit, since $F(x,y,u+h)-F(x,y,u)=f(x(u,v),y(u,v))-f(x(u,v),y(u,v))=0$). – R24698 Jan 09 '24 at 18:41
  • For $h(u,v)=f(g(u,v))=f(x(u,v),y(u,v))$, there’s no reason at all to expect $\frac{\partial h}{\partial u}$ to vanish. Just look at the difference quotient (your latest comment is wrong): $\frac{h(u+\delta,v)-h(u,v)}{\delta}=\frac{f(x(u+\delta,v),y(u+\delta,v))-f(x(u,v),y(u,v))}{\delta}$, and there’s no reason for this to be $0$. In fact, the chain rule gives you a nice explicit formula for the partial derivative: $\frac{\partial h}{\partial u}=\frac{\partial f}{\partial x}\frac{\partial x}{\partial u}+\frac{\partial f}{\partial y}\frac{\partial y}{\partial u}$ (everything evaluated suitably). – peek-a-boo Jan 09 '24 at 21:29
  • also, your definition of $F(x,y,u)$ is meaningless. If you mean $F(x,y,u)=f(x,y)$, then yes $\frac{\partial F}{\partial u}=0$, and I’ve said this in various guises in my various answers and comments. However, for $h(u,v)=f(g(u,v))$ above, $\frac{\partial h}{\partial u}$ is NOT necessarily zero. You’re once again mixing up all the functions. – peek-a-boo Jan 09 '24 at 21:31
  • 1
    here’s the golden rule for avoiding all these confusions: write clear definitions of the functions involved (and for your own sake, avoid typos, and avoid reusing letters for different purposes), and then if really necessary, write down the difference quotients. THings will be very obvious then. – peek-a-boo Jan 09 '24 at 21:37